Revert _local_exists
to mirror fsspec
behavior
#4186
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.
Description
The current implementation of
_local_exists
is different from how theexists
method exposed byfsspec
implementations works, in that it checks parent directories. This prevents the code path from reachingNotADirectoryError
(e.g. if you try saving a versioned dataset on top of an unversioned one), resulting in a different/inconsistent error message from one of thefsspec
-based dataset implementations.Development notes
This essentially reverts a very old change in b0581f1, which predates
fsspec
use.Existing dataset implementations (usually?) define their own
exists_function
usingfsspec
, so this doesn't normally get hit.I ran into this while trying to implement basic versioning of
ibis.FileDataset
, because thetest_versioning_existing_dataset
was failing with a different error message than one would expect (due to the above note onNotADirectoryError
).Developer Certificate of Origin
We need all contributions to comply with the Developer Certificate of Origin (DCO). All commits must be signed off by including a
Signed-off-by
line in the commit message. See our wiki for guidance.If your PR is blocked due to unsigned commits, then you must follow the instructions under "Rebase the branch" on the GitHub Checks page for your PR. This will retroactively add the sign-off to all unsigned commits and allow the DCO check to pass.
Checklist
RELEASE.md
file