fix(config): let an explicitly falsy value on the right-hand side win… · apache/iceberg-python@d888dd1 · GitHub
Skip to content

Commit d888dd1

Browse files
fix(config): let an explicitly falsy value on the right-hand side win in merge_config (#4005)
fix(config): let an explicitly falsy value on the right-hand side win merge_config() documents 'take the non-null value, with precedence on rhs', but it used `rhs_value or lhs_value`, which falls back to the left-hand side for any falsy value, not just None. load_catalog(name, **properties) merges the configuration file into the caller's properties, so turning an option off explicitly was silently ignored when the file set it: # .pyiceberg.yaml has s3.path-style-access: "true" load_catalog("prod", **{"s3.path-style-access": False}) # -> 's3.path-style-access' stays 'true' That contradicts the intent of #45, which made the passed-in argument take precedence over the environment. property_as_bool() in the same codebase already distinguishes 'not set' from falsy by testing against (None, ""), so the two now agree. None on the right-hand side still means 'not set' and keeps the left-hand value.
1 parent 4dba4a4 commit d888dd1

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

‎pyiceberg/utils/config.py‎

Lines changed: 3 additions & 2 deletions

‎tests/utils/test_config.py‎

Lines changed: 23 additions & 1 deletion

0 commit comments

Comments
 (0)