rambleraptor commented on code in PR #4274:
URL: https://github.com/apache/iceberg-python/pull/4274#discussion_r4459075574
##########
pyiceberg/io/pyarrow.py:
##########
@@ -3218,6 +3218,11 @@ def _partition_value_filter(partition_field_name: str,
value: Any) -> pc.Express
return pc.field(partition_field_name).is_null()
elif isinstance(value, float) and math.isnan(value):
return pc.is_nan(pc.field(partition_field_name))
+ elif isinstance(value, float) and value == 0.0:
Review Comment:
```suggestion
elif isinstance(value, float) and value == 0.0:
# -0.0 and 0.0 are separate partitions but compare equal, so also match
the sign (1 / -0.0 is -inf)
field = pc.field(partition_field_name)
return (field == value) & (pc.divide(pc.scalar(1.0), field) ==
math.copysign(math.inf, value))
```
This feels like a cleaner way to express this.
--
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]