shashank11yadav commented on code in PR #4620:
URL: https://github.com/apache/iceberg-python/pull/4620#discussion_r4807197755


##########
tests/table/test_inspect.py:
##########
@@ -308,3 +308,12 @@ def 
test_inspect_after_promoting_then_dropping_partition_column(catalog: InMemor
     assert tbl.inspect.manifests().to_pydict()["partition_summaries"][0] == [
         {"contains_null": False, "contains_nan": False, "lower_bound": "10", 
"upper_bound": "20"}
     ]
+
+
+def 
test_inspect_files_with_snapshot_id_zero_on_table_without_snapshots(catalog: 
InMemoryCatalog) -> None:
+    tbl = catalog.create_table("default.no_snapshots", Schema(NestedField(1, 
"x", LongType(), required=False)))
+
+    for inspect_files in [tbl.inspect.files, tbl.inspect.data_files, 
tbl.inspect.delete_files]:
+        assert inspect_files().num_rows == 0
+        with pytest.raises(ValueError, match="Cannot find snapshot with ID 0"):
+            inspect_files(snapshot_id=0)

Review Comment:
   Done in 342f45b. I parametrized over the method names and call 
`getattr(tbl.inspect, method)`, the same way 
`test_inspect_files_of_snapshot_without_manifests` does, instead of using the 
suggestion as written: `files`, `data_files` and `delete_files` are plain 
methods rather than properties, so `.fget` isn't there, and they need 
`tbl.inspect` as `self`, not `tbl`. It's now three cases, `[files]`, 
`[data_files]` and `[delete_files]`, and all three fail without the fix.
   



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