hcrosse commented on code in PR #4280:
URL: https://github.com/apache/iceberg-python/pull/4280#discussion_r4474840713
##########
pyiceberg/typedef.py:
##########
@@ -173,6 +174,10 @@ class IcebergRootModel(RootModel[T], Generic[T]):
model_config = ConfigDict(frozen=True)
+def _is_nan(value: Any) -> bool:
Review Comment:
Thanks for the suggestion. I kept `_is_nan` private for now, since only
`_same_value` uses it.
##########
pyiceberg/typedef.py:
##########
@@ -196,8 +201,15 @@ def __getitem__(self, pos: int) -> Any:
return self._data[pos]
def __eq__(self, other: Any) -> bool:
- """Return the equality of two instances of the Record class."""
- return self._data == other._data if isinstance(other, Record) else
False
+ """Compare records, treating NaN floats at the same position as
equal."""
Review Comment:
Thanks, I extracted `_same_value` and used `all` as suggested. Behavior is
unchanged, and the existing NaN tests cover it.
--
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]