Copilot commented on code in PR #2220:
URL: https://github.com/apache/iceberg-python/pull/2220#discussion_r2223578764
##########
tests/integration/test_rest_catalog.py:
##########
@@ -61,3 +62,22 @@ def test_create_namespace_if_already_existing(catalog:
RestCatalog) -> None:
catalog.create_namespace_if_not_exists(TEST_NAMESPACE_IDENTIFIER)
assert catalog.namespace_exists(TEST_NAMESPACE_IDENTIFIER)
+
+
[email protected]
[email protected]_trino
[email protected]("catalog", [pytest.lazy_fixture("session_catalog")])
+def test_schema_exists_in_trino(trino_rest_conn: Connection, catalog:
RestCatalog) -> None:
+ """Verifies that an Iceberg namespace correctly appears as a schema in
Trino.
+
+ This test ensures the synchronization between Iceberg's namespace concept
and
+ Trino's schema concept, confirming that after creating a namespace in the
Iceberg
+ catalog, it becomes visible as a schema in the Trino environment.
+ """
+
+ if not catalog.namespace_exists(TEST_NAMESPACE_IDENTIFIER):
Review Comment:
The logic is inverted. This condition will drop the namespace when it
doesn't exist, which will cause an error. It should be `if
catalog.namespace_exists(TEST_NAMESPACE_IDENTIFIER):`
```suggestion
if catalog.namespace_exists(TEST_NAMESPACE_IDENTIFIER):
```
--
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]