Fokko commented on code in PR #6398:
URL: https://github.com/apache/iceberg/pull/6398#discussion_r1137346006


##########
python/tests/test_integration.py:
##########
@@ -0,0 +1,81 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# pylint:disable=redefined-outer-name
+
+import math
+
+import pytest
+
+from pyiceberg.catalog import Catalog, load_catalog
+from pyiceberg.expressions import IsNaN, NotNaN
+from pyiceberg.table import Table
+
+
[email protected]()
+def catalog() -> Catalog:
+    return load_catalog(
+        "local",
+        **{
+            "type": "rest",
+            "uri": "http://localhost:8181";,
+            "s3.endpoint": "http://localhost:9000";,
+            "s3.access-key-id": "admin",
+            "s3.secret-access-key": "password",
+        },
+    )
+
+
[email protected]()
+def table_test_null_nan(catalog: Catalog) -> Table:
+    return catalog.load_table("default.test_null_nan")
+
+
[email protected]()
+def table_test_null_nan_rewritten(catalog: Catalog) -> Table:
+    return catalog.load_table("default.test_null_nan_rewritten")
+
+
[email protected]
+def test_pyarrow_nan(table_test_null_nan: Table) -> None:
+    arrow_table = table_test_null_nan.scan(row_filter=IsNaN("col_numeric"), 
selected_fields=("idx", "col_numeric")).to_arrow()
+    assert len(arrow_table) == 1
+    assert arrow_table[0][0].as_py() == 1
+    assert math.isnan(arrow_table[1][0].as_py())

Review Comment:
   Let me rewrite those tests a bit



-- 
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]

Reply via email to