Fokko commented on code in PR #3492:
URL: https://github.com/apache/iceberg-python/pull/3492#discussion_r3790119550
##########
pyiceberg/utils/properties.py:
##########
@@ -54,13 +54,13 @@ def property_as_float(
def property_as_bool(
- properties: dict[str, str],
+ properties: Properties,
property_name: str,
default: bool,
) -> bool:
- if value := properties.get(property_name):
+ if (value := properties.get(property_name)) not in (None, ""):
Review Comment:
This makes sense:
```python
def strtobool(val: str) -> bool:
"""Convert a string representation of truth to true (1) or false (0).
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if
'val' is anything else.
"""
val = val.lower()
if val in ("y", "yes", "t", "true", "on", "1"):
return True
elif val in ("n", "no", "f", "false", "off", "0"):
return False
else:
raise ValueError(f"Invalid truth value: {val!r}")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]