This is an automated email from the ASF dual-hosted git repository.

kevinjqliu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-python.git


The following commit(s) were added to refs/heads/main by this push:
     new 04088cb3 Catalog tests around nonexistent tables + namespaces (#2990)
04088cb3 is described below

commit 04088cb351172f30fb6f906df6c694e7e32c10d8
Author: Alex Stephen <[email protected]>
AuthorDate: Sat Jan 31 10:50:41 2026 -0800

    Catalog tests around nonexistent tables + namespaces (#2990)
    
    <!--
    Thanks for opening a pull request!
    -->
    
    <!-- In the case this PR will resolve an issue, please replace
    ${GITHUB_ISSUE_ID} below with the actual Github issue id. -->
    <!-- Closes #${GITHUB_ISSUE_ID} -->
    
    # Rationale for this change
    More catalog tests! I wanted to add tests around renaming nonexistent
    tables/namespaces, as well as loading nonexistent tables.
    
    The great news is that these are working as intended across all of our
    catalogs!
    
    ## Are these changes tested?
    Just tests.
    
    ## Are there any user-facing changes?
    Just tests.
    
    <!-- In the case of user-facing changes, please add the changelog label.
    -->
---
 tests/integration/test_catalog.py | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/tests/integration/test_catalog.py 
b/tests/integration/test_catalog.py
index 0e39beb2..c164bed8 100644
--- a/tests/integration/test_catalog.py
+++ b/tests/integration/test_catalog.py
@@ -823,3 +823,40 @@ def test_drop_nonexistent_namespace(test_catalog: Catalog) 
-> None:
     namespace = ("non_existent_namespace",)
     with pytest.raises(NoSuchNamespaceError):
         test_catalog.drop_namespace(namespace)
+
+
[email protected]
[email protected]("test_catalog", CATALOGS)
+def test_rename_table_missing_source_table(test_catalog: Catalog, table_name: 
str, database_name: str) -> None:
+    test_catalog.create_namespace_if_not_exists(database_name)
+    identifier = (database_name, table_name)
+    new_identifier = (database_name, f"rename-{table_name}")
+
+    with pytest.raises(NoSuchTableError):
+        test_catalog.rename_table(identifier, new_identifier)
+
+
[email protected]
[email protected]("test_catalog", CATALOGS)
+def test_rename_table_destination_namespace_missing(
+    test_catalog: Catalog, table_schema_nested: Schema, table_name: str, 
database_name: str
+) -> None:
+    test_catalog.create_namespace_if_not_exists(database_name)
+    identifier = (database_name, table_name)
+    test_catalog.create_table(identifier, table_schema_nested)
+
+    new_database_name = "non_existent_namespace"
+    new_identifier = (new_database_name, table_name)
+
+    with pytest.raises(NoSuchNamespaceError):
+        test_catalog.rename_table(identifier, new_identifier)
+
+
[email protected]
[email protected]("test_catalog", CATALOGS)
+def test_load_missing_table(test_catalog: Catalog, database_name: str, 
table_name: str) -> None:
+    test_catalog.create_namespace_if_not_exists(database_name)
+    identifier = (database_name, table_name)
+
+    with pytest.raises(NoSuchTableError):
+        test_catalog.load_table(identifier)

Reply via email to