Repository navigation
fix: normalize DBFS paths before file downloads - #1635
Open
Swarneil1905 wants to merge 1 commit into
Open
Swarneil1905 wants to merge 1 commit into
Swarneil1905 wants to merge 1 commit into
Conversation
Signed-off-by: Swarneil Pradhan <swarneil1905@gmail.com>
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.
Summary
Normalize
dbfs:/Volumes/...paths infiles.download()andfiles.download_to()so downloads can fall back to the Files API using a valid URL.Fixes #1630.
Why
When an offloaded download fails, the SDK falls back to the Files API. Paths containing the
dbfs:prefix are currently appended directly to the API endpoint, producing an invalid path such as/api/2.0/fs/filesdbfs%3A/Volumes/...and causing a 404.Removing the leading scheme before download processing allows the fallback to request the correct file.
What changed
Interface changes
No signature changes. Updated both download method docstrings to document
dbfs:/Volumes/...paths.Behavioral changes
dbfs:prefix before download and metadata requests./Volumes/...paths anddbfs:text within filenames.Internal changes
dbfs:paths.How is this tested?
Validated locally on Windows:
uv run --locked pytest tests/ -q -o log_cli=false --tb=short: 4036 passed, 192 skipped, 13 warnings.uv run --locked ruff check databricks tests: passed.uv run --locked ruff format --check databricks tests: passed.git diff --check: passed.The new tests use mocked HTTP responses. Parallel download tests remain skipped on Windows. No live Databricks workspace testing was performed.