Fokko commented on code in PR #2371:
URL: https://github.com/apache/iceberg-python/pull/2371#discussion_r2303368316


##########
tests/integration/test_catalog.py:
##########
@@ -218,6 +224,132 @@ def test_table_exists(test_catalog: Catalog, 
table_schema_nested: Schema, databa
     assert test_catalog.table_exists((database_name, table_name)) is True
 
 
[email protected]
[email protected]("test_catalog", CATALOGS)
+def test_update_table_transaction(test_catalog: Catalog, test_schema: Schema, 
table_name: str, database_name: str) -> None:
+    identifier = (database_name, table_name)
+
+    test_catalog.create_namespace(database_name)
+    table = test_catalog.create_table(identifier, test_schema)
+    assert test_catalog.table_exists(identifier)
+
+    expected_schema: Schema = Schema()
+    expected_spec: PartitionSpec = UNPARTITIONED_PARTITION_SPEC
+
+    with table.transaction() as transaction:
+        with transaction.update_schema() as update_schema:
+            update_schema.add_column("new_col", IntegerType())
+            expected_schema = update_schema._apply()

Review Comment:
   I would rather hardcode the schema:
   
   - This makes the test more readabile because you can see what you're 
asserting against.
   - There are some idea's of avoid using "private" methods in the community ;)



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