Repository navigation
fix(artifacts): reject hierarchical name collisions in FsspecArtifactService - #8175
Open
tang-ontheway wants to merge 1 commit into
Open
tang-ontheway wants to merge 1 commit into
tang-ontheway wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
tang-ontheway
force-pushed
the
fix/fsspec-hierarchical-name-collision
branch
from
November 16, 2026 08:19
9275253 to
c52efe9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8173
Summary
On hierarchical filesystems (such as
file://andmemory://),FsspecArtifactServicestores versions at{artifact_path}/{version}, so an artifact (e.g.report) and a nested artifact whose next segment is a numeric version (e.g.report/0orreport/0/sub) map the same path to both a file and a directory:reportthenreport/0(orreport/0/sub) raised a rawFileExistsError/NotADirectoryErrorfrommakedirsor retried 10 times before raisingFileExistsError.report/0(orreport/0/sub) thenreporthitFileExistsErroron the existingreport/0directory, treated it as a concurrent save, and silently skipped to version1.This change:
InputValidationErrorinstead of advancing the version counter.makedirsand_write_versionon non-GCS backends and raisesInputValidationErrorinstead of leaking raw filesystem errors or retrying.FsspecArtifactServiceclass docstring.gs://) unaffected.Testing plan
tests/unittests/integrations/fsspec/test_fsspec_artifact_service.pycoveringreport->report/0,report->report/0/sub,report/0->report,report/0/sub->report, and later-version collisions (reportv0 ->report/1->reportv1) on bothmemory://andfile://, plus ags://test verifying flat object stores still allow both.uv run pytest tests/unittests/integrations/fsspec/test_fsspec_artifact_service.py tests/unittests/artifacts/test_artifact_service.py:1682 passed, 26 xfailed(with 1 unrelatedgoogle.authFutureWarning).uv run ruff check src/google/adk/integrations/fsspec/_fsspec_artifact_service.py tests/unittests/integrations/fsspec/test_fsspec_artifact_service.py:All checks passed!.memory://andfile://: both collision directions now raiseInputValidationErrorwithout advancing versions.