raulcd commented on code in PR #55168:
URL: https://github.com/apache/arrow/pull/55168#discussion_r4492399953


##########
python/pyarrow/tests/parquet/test_metadata.py:
##########
@@ -724,6 +724,30 @@ def test_metadata_equals():
         original_metadata.equals(None)
 
 
+def test_parquet_metadata_equals_none(tempdir):
+    table = pa.table({"a": [1, 2, 3]})
+    path = tempdir / "metadata_equals_none.parquet"
+    pq.write_table(table, path)
+
+    metadata = pq.read_metadata(path)
+    row_group = metadata.row_group(0)
+    column_chunk = row_group.column(0)
+    objects = [
+        column_chunk.statistics,
+        column_chunk,
+        row_group,
+        metadata.schema,
+        metadata.schema[0],
+    ]
+    none_value = None
+
+    for obj in objects:
+        assert (obj == none_value) is False
+        assert (obj != none_value) is True

Review Comment:
   those two checks don't seem necessary to me, is there any reason they were 
added?



##########
python/pyarrow/tests/parquet/test_metadata.py:
##########
@@ -724,6 +724,30 @@ def test_metadata_equals():
         original_metadata.equals(None)
 
 
+def test_parquet_metadata_equals_none(tempdir):
+    table = pa.table({"a": [1, 2, 3]})
+    path = tempdir / "metadata_equals_none.parquet"
+    pq.write_table(table, path)
+
+    metadata = pq.read_metadata(path)
+    row_group = metadata.row_group(0)
+    column_chunk = row_group.column(0)
+    objects = [
+        column_chunk.statistics,
+        column_chunk,
+        row_group,
+        metadata.schema,
+        metadata.schema[0],
+    ]
+    none_value = None
+
+    for obj in objects:
+        assert (obj == none_value) is False
+        assert (obj != none_value) is True
+        with pytest.raises(TypeError):
+            obj.equals(none_value)

Review Comment:
   ```suggestion
               obj.equals(None)
   ```



##########
python/pyarrow/tests/parquet/test_metadata.py:
##########
@@ -724,6 +724,30 @@ def test_metadata_equals():
         original_metadata.equals(None)
 
 
+def test_parquet_metadata_equals_none(tempdir):
+    table = pa.table({"a": [1, 2, 3]})
+    path = tempdir / "metadata_equals_none.parquet"
+    pq.write_table(table, path)
+
+    metadata = pq.read_metadata(path)
+    row_group = metadata.row_group(0)
+    column_chunk = row_group.column(0)
+    objects = [
+        column_chunk.statistics,
+        column_chunk,
+        row_group,
+        metadata.schema,
+        metadata.schema[0],
+    ]
+    none_value = None

Review Comment:
   this `none_value` seems pointless, let's just use `None`



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

Reply via email to