Fix/s3 table creds#268
Conversation
|
This PR is targeting If this is a regular feature/fix PR, please change the base branch to Current base: |
📝 WalkthroughWalkthroughVersion increments applied to workspace and Python project configurations (0.3.59 → 0.3.60), alongside refinement to catalog property injection logic that prioritizes server-provided environment variable keys and expands character sanitization rules to include hyphens. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/tower-cmd/src/run.rs`:
- Around line 630-634: The code currently uses
property.environment_variable.unwrap_or_else(...) which treats Some("") as
valid; change the logic that sets name so empty or all-whitespace
environment_variable values are treated as missing by checking/trimming
property.environment_variable before deciding to use it, and only fall back to
create_pyiceberg_catalog_property_name(&catalog.name, &property.name) when the
env var is None or blank; update the assignment that defines name (referencing
property.environment_variable, create_pyiceberg_catalog_property_name,
catalog.name, property.name) to perform that defensive check.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 51727b05-9bc5-487d-960f-22af11cfe272
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.lockuv.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
Cargo.tomlcrates/tower-cmd/src/run.rspyproject.toml
| let name = property | ||
| .environment_variable | ||
| .unwrap_or_else(|| { | ||
| create_pyiceberg_catalog_property_name(&catalog.name, &property.name) | ||
| }); |
There was a problem hiding this comment.
Defensively handle empty environment_variable values.
At Line 630, Some("") will bypass fallback and produce an invalid env var key. Treat empty/whitespace values as missing and then fallback to create_pyiceberg_catalog_property_name.
Suggested patch
- let name = property
- .environment_variable
- .unwrap_or_else(|| {
- create_pyiceberg_catalog_property_name(&catalog.name, &property.name)
- });
+ let name = property
+ .environment_variable
+ .as_deref()
+ .filter(|value| !value.trim().is_empty())
+ .map(str::to_string)
+ .unwrap_or_else(|| {
+ create_pyiceberg_catalog_property_name(&catalog.name, &property.name)
+ });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@crates/tower-cmd/src/run.rs` around lines 630 - 634, The code currently uses
property.environment_variable.unwrap_or_else(...) which treats Some("") as
valid; change the logic that sets name so empty or all-whitespace
environment_variable values are treated as missing by checking/trimming
property.environment_variable before deciding to use it, and only fall back to
create_pyiceberg_catalog_property_name(&catalog.name, &property.name) when the
env var is None or blank; update the assignment that defines name (referencing
property.environment_variable, create_pyiceberg_catalog_property_name,
catalog.name, property.name) to perform that defensive check.
Summary by CodeRabbit
Bug Fixes
Chores