ebyhr commented on code in PR #3603:
URL: https://github.com/apache/iceberg-python/pull/3603#discussion_r3525693714


##########
tests/table/test_inspect.py:
##########
@@ -68,3 +72,26 @@ def 
test_inspect_entries_and_files_render_null_bound(catalog: InMemoryCatalog) -
     files_metrics = tbl.inspect.files().to_pydict()["readable_metrics"][0]["s"]
     assert files_metrics["lower_bound"] is None
     assert files_metrics["upper_bound"] is None
+
+
[email protected]("newest_first", [False, True])
+def 
test_partitions_last_updated_uses_latest_snapshot_regardless_of_order(newest_first:
 bool) -> None:
+    # Manifest entries are visited in manifest order, which is not 
chronological, so the
+    # `partitions` metadata table must keep the snapshot with the highest 
commit timestamp
+    # per partition regardless of the order in which the entries are 
aggregated.
+    older = Snapshot(snapshot_id=6446744073709551000, timestamp_ms=1000, 
manifest_list="file:///dev/null")
+    newer = Snapshot(snapshot_id=8446744073709551111, timestamp_ms=5000, 
manifest_list="file:///dev/null")
+
+    def _data_file() -> DataFile:
+        file = DataFile.from_args(content=DataFileContent.DATA, 
record_count=1, file_size_in_bytes=1, partition=Record("a"))
+        file.spec_id = 0
+        return file

Review Comment:
   nit:  A single shared instance without the inner `_data_file()` works fine 
here:
   ```py
       data_file = DataFile.from_args(content=DataFileContent.DATA, 
record_count=1, file_size_in_bytes=1, partition=Record("a"))
       data_file.spec_id = 0
   ```



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