pitrou commented on code in PR #39781:
URL: https://github.com/apache/arrow/pull/39781#discussion_r1480274554
##########
python/pyarrow/tests/parquet/test_metadata.py:
##########
@@ -499,6 +499,24 @@ def test_multi_dataset_metadata(tempdir):
assert md['serialized_size'] > 0
+def test_metadata_hashing(tempdir):
+ path1 = str(tempdir / "metadata1")
+ schema1 = pa.schema([("a", "int64"), ("b", "float64")])
+ pq.write_metadata(schema1, path1)
+ parquet_meta1 = pq.read_metadata(path1)
+
+ path2 = str(tempdir / "metadata2")
+ schema2 = pa.schema([("a", "int64"), ("b", "float32")])
+ pq.write_metadata(schema2, path2)
+ parquet_meta2 = pq.read_metadata(path2)
+
+ # Deterministic
+ assert hash(parquet_meta1) == hash(parquet_meta1)
Review Comment:
Ok, but should also check that two equal but distinct instances also hash
equally.
--
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]