Repository navigation
Remove the positional detail argument of find() - #450
Draft
shcheklein wants to merge 2 commits into
Draft
shcheklein wants to merge 2 commits into
shcheklein wants to merge 2 commits into
Conversation
find(path, True) took True as detail, a form PyDrive2 1.x used, and warned. The second argument is maxdepth, as in other fsspec filesystems, and True would quietly mean a depth of 1, so a boolean there now raises TypeError. The upgrade guide says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
shcheklein
commented
Dec 3, 2026
shcheklein
commented
Dec 3, 2026
shcheklein
left a comment
Member
Author
There was a problem hiding this comment.
[AI generated — Copilot]
5-pass review summary: clean, minimal, and well-scoped removal. No bugs, dead code, performance issues, or test issues found — just one minor message suggestion inline.
1 of 2 tasks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No actionable issues were found in the reviewed changes.
No open issues 🎉
What changed in this PR
Removes legacy positional detail support from the filesystem’s find() method while preserving its fsspec-compatible signature.
Changes:
- Rejects boolean
maxdepthvalues with guidance to passdetailby keyword. - Tests invalid depths and confirms rejection occurs before network requests.
- Documents the migration in the upgrade guide.
| File | Description |
|---|---|
| pydrive2/test/test_fs_unit.py | Tests boolean and nonpositive depth rejection without requests. |
| pydrive2/fs/spec.py | Replaces the deprecation warning with a TypeError. |
| docs/upgrading.rst | Explains how to migrate positional detail calls. |
Review effort: Balanced
This branch has not been deployed
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.
PyDrive2 1.x took
detailas the second argument offind(). When the filesystem switched to fsspec's signature,find(path, maxdepth=None, withdirs=False, detail=False), a warning kept the old form working. This removes it.Example
Before: a
DeprecationWarning, then a detailed listing of the whole tree.Without the warning,
Truewould be read asmaxdepth, which Python treats as 1: the call would quietly return only the top level of the tree. So a boolean in that position now raises:fs.find(path, detail=True)andfs.find(path, 2)work as before. The upgrade guide gets one paragraph under "Removed names".Validation
find()withTrueorFalseas the depth raisesTypeError, and with 0 or -1 raisesValueErroras before. No live test: the error is raised before any request.-W error::DeprecationWarning(539 passed).🤖 Generated with Claude Code