You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Copilot (via GitHub)" <gi...@apache.org> on 2025/07/22 19:02:56 UTC

Re: [PR] Trino: Add Trino Docker Compose for integration testing [iceberg-python]

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)
+
+
+@pytest.mark.integration
+@pytest.mark.integration_trino
+@pytest.mark.parametrize("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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org