Repository navigation
Conversation
The sync pipe_file override dropped mode, so mode="create" overwrote an existing key instead of raising FileExistsError. Part of fsspec#2470.
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.
ReferenceFileSystemoverrides the syncpipe_fileand takes**_, somodeis dropped andpipe_file(path, data, mode="create")overwrites an existing key instead of raisingFileExistsError. The async_pipe_filealready has this check, but because the sync override exists,_pipe_fileis never mirrored topipe_file.This adds the same check to the sync method. It is the reference half of item 2 in #2470; #2482 covers simplecache.
I kept the method instead of deleting it in favour of
_pipe_file, because #2377 updates the directory listing from this method and removing it would conflict with that PR.Added
test_pipe_file_mode_createin test_reference.py. It fails on main withDID NOT RAISE FileExistsErrorand passes with the change.Ran locally on Windows, Python 3.11:
pytest fsspec/implementations/tests/test_reference.py fsspec/tests/test_mapping.py fsspec/tests/test_async.py: 168 passed, 14 skippedpre-commit runon the changed files: all hooks pass