rambleraptor commented on code in PR #2479:
URL: https://github.com/apache/iceberg-python/pull/2479#discussion_r2370413801
##########
tests/integration/test_catalog.py:
##########
@@ -343,3 +350,64 @@ def test_update_namespace_properties(test_catalog:
Catalog, database_name: str)
else:
assert k in update_report.removed
assert "updated test description" ==
test_catalog.load_namespace_properties(database_name)["comment"]
+
+
[email protected]
[email protected]("test_catalog", CATALOGS)
+def test_update_table_spec(test_catalog: Catalog, table_name: str,
database_name: str) -> None:
+ identifier = (database_name, table_name)
+ test_catalog.create_namespace(database_name)
+ table = test_catalog.create_table(identifier, SIMPLE_SCHEMA)
+
+ with table.update_spec() as update:
+ update.add_field(source_column_name="id",
transform=BucketTransform(16), partition_field_name="shard")
+
+ loaded = test_catalog.load_table(identifier)
+ expected_spec = PartitionSpec(
+ PartitionField(source_id=1, field_id=1000,
transform=BucketTransform(16), name="shard"), spec_id=1
+ )
+ # The spec ID may not match, so check equality of the fields
+ assert loaded.spec().fields == expected_spec.fields
Review Comment:
Looks like this was the bug I uncovered. Removing the comment.
--
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]