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.
What changes are proposed in this pull request?
Currently databricks-sdk-py does not handle recursive list properly. For instance if your file structure exists with nested directories as such
Here is the stack trace
It seems that the loop will try to list the content directory of
Volumes/DirA/DirC/
at some point. Instead ofVolumes/DirA/DirB/DirC/
The issue stems from the
list
function in_VolumePath
indatabricks/sdk/mixins/files.py
. While looping it tries to replace the last element in the deque withself.child(file.name)
unfortunately as the base path of_VolumePath
is never modified instead of appendingDirB/DirC
to that path, it will simply appendDirC
to the base volume path.Specifically, try to answer the two following questions:
WHAT changes are being made in the PR?
WHY are these changes needed? This should provide the context that the
reader might be missing. For example, were there any decisions behind the
change that are not reflected in the code itself?
How is this tested?
Describe any tests you have done; especially if test tests are not part of
the unit tests (e.g. local tests).
I created a new project and ran the following code
I cloned databricks-sdk-py and imported it in editable mode and ran it before and after. With the change it no longer errors out and correctly displays all files in the nested directories