Fokko opened a new issue, #4529:
URL: https://github.com/apache/iceberg-python/issues/4529
Follow-ups from the review of #4489.
- [ ] **Use the same null/empty check everywhere.** `property_as_bool` uses
`not in (None, "")`, while `property_as_int`, `property_as_float` and
`get_first_property_value` use `is not None and value != ""`. Use `not in
(None, "")` in all four.
- [ ] **Use the same parameter type everywhere.** `property_as_int` and
`property_as_float` take `Mapping[str, Any]`, while `property_as_bool` and
`get_first_property_value` take `Properties`. Pick one for all helpers.
- [ ] **Fix the `*_with_invalid_value` tests.** In
`tests/utils/test_properties.py`, the `assert ... in str(exc.value)` is inside
the `with pytest.raises(...)` block, so it never runs. Move it out of the
block, or use `pytest.raises(ValueError, match=...)`.
- [ ] **Document the deviation from Java.** Java's `PropertyUtil` only
checks `value != null`, so `""` makes `propertyAsInt` and `propertyAsDouble`
throw and makes `propertyAsString` return `""`. PyIceberg treats `""` as unset.
Add a short comment on the helpers saying this is intentional.
- [ ] **(Optional) Reject bools in numeric helpers.** `property_as_int({"k":
False}, "k", 4)` returns `0`, while Java would throw on `"false"`. Decide
whether to reject `bool` in `property_as_int` and `property_as_float`.
--
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]