SML0127 commented on code in PR #307:
URL: https://github.com/apache/paimon-rust/pull/307#discussion_r3556511793
##########
bindings/python/tests/test_datafusion.py:
##########
@@ -685,3 +685,40 @@ def test_list_databases_and_tables():
# simple_log_table is non-partitioned, so partition keys are empty.
assert schema.partition_keys() == []
+# ---------------- #285: observability ----------------
+def test_snapshots_for_simple_table():
+ catalog = PaimonCatalog({"warehouse": WAREHOUSE})
+ table = catalog.get_table("default.simple_log_table")
+
+ snap = table.latest_snapshot()
+ assert snap is not None
+ assert snap.id() >= 1
+ assert snap.commit_time_ms() > 0
+ assert snap.commit_kind() in {"APPEND", "COMPACT", "OVERWRITE", "ANALYZE"}
+
+ snaps = table.list_snapshots()
+ assert len(snaps) >= 1
+ # Newest first.
+ assert snaps[0].id() == snap.id()
+
+
+def test_partitions_and_tags_smoke():
+ catalog = PaimonCatalog({"warehouse": WAREHOUSE})
+ table = catalog.get_table("default.simple_log_table")
+
+ # Non-partitioned, non-tagged table: both should be empty but well-typed.
+ parts = table.list_partitions()
+ stats = table.partition_stats()
+ tags = table.list_tags()
+
+ assert isinstance(parts, list)
+ assert isinstance(stats, list)
+ assert isinstance(tags, list)
+ # simple_log_table has no partition keys -> partition_stats yields a single
Review Comment:
Thanks for the feedback. I added
`test_partition_stats_with_partitioned_table()` and
`test_partition_stats_excludes_overwritten_partition()` to cover the cases you
mentioned.
--
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]