Allow listing an empty drive root#64
Open
gaoflow wants to merge 2 commits into
Open
Conversation
Member
|
What happens if the drive in question doesn't exist at all? I would expect FileNotFound rather than an empty listing. |
gaoflow
force-pushed
the
fix-59-empty-root-ls
branch
from
June 19, 2026 19:45
ed56d6f to
01ede5e
Compare
Contributor
Author
|
Good point. I updated the branch so the empty-root case and missing-root case are distinct. Current behavior after
I also rebased the branch onto the latest Verification: .venv/bin/python -m pytest tests/test_core.py -q
# 31 passed, 2 deselected in 0.06s
.venv/bin/python -m pytest -q
# 31 passed, 2 deselected in 0.06s
ruff check gdrive_fsspec/core.py tests/test_core.py
# All checks passed!
ruff format --check gdrive_fsspec/core.py tests/test_core.py
# 2 files already formatted
git diff --check origin/master...HEAD
# no output |
| @@ -316,6 +324,17 @@ def info(self, path, trashed=False): | |||
| } | |||
| return super().info(path, trashed=trashed) | |||
|
|
|||
| def _file_id_exists(self, file_id): | |||
Member
There was a problem hiding this comment.
Basically the same as self._list_directory_by_id ?
| and not files | ||
| and self.drive is None | ||
| and file_id != "root" | ||
| and not self._file_id_exists(file_id) |
Member
There was a problem hiding this comment.
This gets rechecked on every call. That is ... OK, the cache doesn't have a way to say "tried but not found".
gaoflow
force-pushed
the
fix-59-empty-root-ls
branch
from
July 15, 2026 08:14
01ede5e to
44e4160
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.
Summary
FileNotFoundErrorfor missing non-root pathsTests
.venv/bin/python -m pytest -q.venv/bin/pre-commit run --files gdrive_fsspec/core.py tests/test_core.pyFixes #59
AI assistance was used under my direction.