Using S3 creds in storage_options results in side effect of setting env vars #1695
Labels
binding/rust
Issues for the Rust crate
bug
Something isn't working
good first issue
Good for newcomers
storage/aws
AWS S3 storage related
Milestone
Environment
Delta-rs version: 0.14.0
Binding: Rust
Environment: macOS Ventura 13.4
Bug
What happened:
When passing in S3 creds via storage options to create a delta table, ie AWS_ACCESS_KEY_ID, this has an unintended side-effect of overriding set environment variables.
What you expected to happen:
S3 values to be used from the storage options map without setting any environment variables.
How to reproduce it:
let storage_options_invalid: HashMap<String, String> = HashMap::from([
(
"AWS_DEFAULT_REGION".to_string(),
env::var("AWS_DEFAULT_REGION").unwrap().to_string(),
),
(
"AWS_SECRET_ACCESS_KEY".to_string(),
env::var("AWS_SECRET_ACCESS_KEY").unwrap().to_string(),
),
("AWS_ACCESS_KEY_ID".to_string(), "INVALID123".to_string()),
(
"AWS_SESSION_TOKEN".to_string(),
env::var("AWS_SESSION_TOKEN")
.unwrap_or("".to_string())
.to_string(),
),
]);
println!("{}",env::var("AWS_ACCESS_KEY_ID").unwrap().to_string()); // Prints correct value
let mut table = deltalake::open_table_with_storage_options(
table_filepath.as_str(),
storage_options_invalid,
)
println!("{}",env::var("AWS_ACCESS_KEY_ID").unwrap().to_string()); // Prints "INVALID123"
The text was updated successfully, but these errors were encountered: