fix(storage-azdls): relative path is wrong for non-ASCII and spaces - #3163
Open
jackylee-ch wants to merge 1 commit into
Open
fix(storage-azdls): relative path is wrong for non-ASCII and spaces#3163jackylee-ch wants to merge 1 commit into
jackylee-ch wants to merge 1 commit into
Conversation
AzureStoragePath::path held Url::path(), which is percent-encoded, while both consumers recover the relative path by slicing that many bytes off the raw input. Keep the raw substring instead, as HfUri::parse already does.
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped to ADLS path parsing, matches the stated root cause, and is covered by targeted unit tests for the reported failure cases.
Pull request overview
Fixes OpenDAL ADLS (azdls) path handling so relative-path extraction remains correct when absolute URIs contain spaces or non-ASCII characters, avoiding percent-encoding length mismatches that can corrupt the sliced relative path used by ADLS operations.
Changes:
- Store
AzureStoragePath::pathas a raw substring of the input URI (instead ofUrl::path()), preserving byte-for-byte identity for consumers that slice by length. - Add unit test coverage for ADLS URIs containing a non-ASCII segment and a space in the path.
File summaries
| File | Description |
|---|---|
| crates/storage/opendal/src/azdls.rs | Preserve raw (non-percent-encoded) path for ADLS URI parsing and extend unit tests for non-ASCII/space path cases. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Which issue does this PR close?
None — filed directly.
What changes are included in this PR?
AzureStoragePath::pathstoredUrl::path(), which is percent-encoded, while both consumersrecover the relative path by slicing that many bytes off the raw input string
(
azdls.rsazdls_create_operator, andlib.rsrelativize_path, used bydelete_stream). Anyspace or non-ASCII byte makes the encoded length longer than the input, so the offset lands inside
the host:
Reads then miss a blob that exists; writes create it under the mangled key while the manifest
records the correct
abfss://URI. Keeping the raw substring fixes both consumers, solib.rsneeds no change.
HfUri::parsealready derives itspathfrom the raw input this way.Are these changes tested?
Yes — two cases added to
test_azdls_create_operator(a non-ASCII segment and a space); both failon the parent commit.
cargo test --release -p iceberg-storage-opendal --lib --features opendal-azdls→ 14 passed (13 before). With--all-features,file_io_gcs_testfails 4 tests withConnection refusedhere and identically on unmodifiedmain— it needs the docker fixture.AI Disclosure
Written with AI assistance (Claude Code); I reviewed the change and ran the tests above.
Note for reviewers: this backend still has no integration test, so the fix is covered by unit tests
only. I did not verify against a live ADLS account.