LiyangTseng opened a new pull request, #3759: URL: https://github.com/apache/iceberg-rust/pull/3759
## Which issue does this PR close? - Closes #3749. ## What changes are included in this PR? `AzureStoragePath::relative_path` cut `url.path().len()` bytes off the end of the location. `Url::path` is not the same text as the location, so the slice landed in the wrong place whenever the two differ: - a query or fragment (for example a SAS token), which ended up in the key; - characters that `Url::parse` percent-encodes, such as a space or non-ASCII, so the slice started too early (the cases from #3163, which the stale bot closed; this PR reuses its two test cases); - long non-ASCII paths, where the encoded path is longer than the whole location and the subtraction panics. The relative path is now taken from the location text itself: after the authority, before the first `?` or `#`, not percent-decoded. The `relative_path` signature and its callers are unchanged. A question for maintainers: this PR drops the query and fragment. Would you rather reject ADLS locations that have a query, like one of the options in #3751? I can switch. Known limitations: - A file name with a literal `?` can't be written in a location; it would be read as the start of the query. - Leading/trailing whitespace is not trimmed the way `Url::parse` trims it. ## Are these changes tested? Yes, with unit tests in `azdls.rs`: a table of locations (query, fragment, both, `wasbs`, space, non-ASCII, already percent-encoded, empty path with a query) checked with a single `assert_eq!`, and a regression test for the long non-ASCII panic. Both fail on `main`. I didn't test against a live ADLS account. ## AI Disclosure I used an AI assistant (Claude) to understand the code, settle the design, and write the implementation, the tests and this description. I reviewed the change and ran the tests, fmt and clippy locally. Please look closely at the query policy (dropping vs. rejecting) and the parsing in `raw_path`; I didn't check them against a real ADLS account. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
