From bc69a01e9ac842542a1965ba7ac2cd7795122f7f Mon Sep 17 00:00:00 2001 From: Simon Rosenberger Date: Sun, 26 Apr 2026 09:55:54 +0200 Subject: [PATCH] Fix: names of s3 catalog env vars --- crates/tower-cmd/src/run.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/tower-cmd/src/run.rs b/crates/tower-cmd/src/run.rs index 3378dc83..1033e872 100644 --- a/crates/tower-cmd/src/run.rs +++ b/crates/tower-cmd/src/run.rs @@ -615,7 +615,9 @@ async fn get_catalogs( let mut vals = HashMap::new(); for catalog in res.catalogs { - // we will decrypt each property and inject it into the vals map. + // Decrypt each property and inject it into the vals map. The API returns + // the correct environment_variable name for each property (including S3 + // Tables remapping, static constants, and derived URI). for property in catalog.properties { let decrypted_value = crypto::decrypt(private_key.clone(), property.encrypted_value.to_string()) @@ -625,7 +627,11 @@ async fn get_catalogs( "Failed to decrypt catalog property", )) })?; - let name = create_pyiceberg_catalog_property_name(&catalog.name, &property.name); + let name = property + .environment_variable + .unwrap_or_else(|| { + create_pyiceberg_catalog_property_name(&catalog.name, &property.name) + }); vals.insert(name, decrypted_value); } } @@ -743,10 +749,12 @@ async fn monitor_cli_status( fn create_pyiceberg_catalog_property_name(catalog_name: &str, property_name: &str) -> String { let catalog_name = catalog_name + .replace('-', "_") .replace('.', "_") .replace(':', "_") .to_uppercase(); let property_name = property_name + .replace('-', "_") .replace('.', "_") .replace(':', "_") .to_uppercase();