Unify from_env behaviours#652
Merged
crepererum merged 5 commits intoMar 3, 2026
Merged
Conversation
crepererum
reviewed
Mar 2, 2026
| let builder = $options.into_iter().fold( | ||
| <$builder>::new().with_url($url.to_string()), | ||
| |builder, (key, value)| match key.as_ref().parse() { | ||
| |builder, (key, value)| match key.as_ref().to_ascii_lowercase().parse() { |
Contributor
There was a problem hiding this comment.
Can we have a test for this code change?
Contributor
Author
There was a problem hiding this comment.
Done, updated test_url_http to account for this
kylebarron
approved these changes
Mar 2, 2026
crepererum
approved these changes
Mar 3, 2026
Contributor
|
thank you |
madesroches
added a commit
to madesroches/micromegas
that referenced
this pull request
Mar 18, 2026
## Summary - Lowercase all env var keys before passing to `object_store::parse_url_opts` to work around a case sensitivity bug in the `object_store` crate - `AmazonS3ConfigKey::from_str` only matches lowercase keys (e.g. `aws_container_credentials_relative_uri`), but OS env vars are uppercase (`AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`), causing them to be silently dropped - Applied to both call sites: `BlobStorage::connect` and `StaticTablesConfigurator::new` - Workaround can be reverted once `object_store` releases a fix (apache/arrow-rs-object-store#652) Fixes #951 ## Test plan - `cargo fmt --check` — passes - `cargo clippy --workspace -- -D warnings` — passes - `cargo test` — passes - Verified the fix matches the approach used internally by `AmazonS3Builder::from_env()`
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?
Closes #529.
Rationale for this change
I just ran into this issue myself after generalizing my use of
AmazonS3viafrom_envtoDefaultObjectStoreRegistry. A cursory look at the code suggests the intended effect is equivalence, but that's not the observed effect.This is so due to
AmazonS3Builder::from_envcalling.to_ascii_lowercase, and well enough,the GCP and
Azuredo the same thing.parse_url_optsbeing the outlier here suggests it's the wrong one, and therefore to offer some consistency, it should be patched to match.PS:
AmazonS3Buildersaysarrow-rs-object-store/src/aws/builder.rs
Line 549 in 907653e
Which also contradicts its very own implementation. (It's also the only one to say this)
And finally, I don't think a single dependency should dictate the casing of project-wide env vars. (especially as AWS itself documents these in
SCREAMING_SNAKE_CASE.What changes are included in this PR?
parse_url_opts, like the otherfrom_envimplementations, now also parses env vars case-insensitively.Are there any user-facing changes?
Yes, documentation updated