@@ -637,6 +637,7 @@ def test_rest_custom_namespace_separator(rest_catalog: RestCatalog, table_schema
637637 loaded_table = rest_catalog .load_table (identifier = full_table_identifier_tuple )
638638 assert loaded_table .name () == full_table_identifier_tuple
639639
640+
640641def _namespace_exists (catalog : Catalog , namespace : str | Identifier ) -> bool :
641642 try :
642643 catalog .load_namespace_properties (namespace )
@@ -648,7 +649,7 @@ def _namespace_exists(catalog: Catalog, namespace: str | Identifier) -> bool:
648649@pytest .mark .integration
649650@pytest .mark .parametrize ("test_catalog" , CATALOGS )
650651def test_namespace_with_slash (test_catalog : Catalog ) -> None :
651- if isinstance (test_catalog , ( HiveCatalog , SqlCatalog , RestCatalog ) ):
652+ if isinstance (test_catalog , HiveCatalog ):
652653 pytest .skip (f"{ type (test_catalog ).__name__ } does not support slash in namespace" )
653654
654655 namespace = ("new/db" ,)
@@ -671,7 +672,7 @@ def test_namespace_with_slash(test_catalog: Catalog) -> None:
671672@pytest .mark .integration
672673@pytest .mark .parametrize ("test_catalog" , CATALOGS )
673674def test_namespace_with_dot (test_catalog : Catalog ) -> None :
674- if isinstance (test_catalog , (HiveCatalog , SqlCatalog , RestCatalog )):
675+ if isinstance (test_catalog , (HiveCatalog , SqlCatalog )):
675676 pytest .skip (f"{ type (test_catalog ).__name__ } does not support dot in namespace" )
676677
677678 namespace = ("new.db" ,)
@@ -685,7 +686,11 @@ def test_namespace_with_dot(test_catalog: Catalog) -> None:
685686 assert _namespace_exists (test_catalog , namespace )
686687
687688 # list_namespaces returns a list of tuples
688- assert namespace in test_catalog .list_namespaces ()
689+ if isinstance (test_catalog , RestCatalog ):
690+ namespaces = test_catalog .list_namespaces ()
691+ assert ("new" ,) in namespaces or ("new.db" ,) in namespaces
692+ else :
693+ assert namespace in test_catalog .list_namespaces ()
689694
690695 properties = test_catalog .load_namespace_properties (namespace )
691696 assert properties is not None
@@ -697,7 +702,7 @@ def test_namespace_with_dot(test_catalog: Catalog) -> None:
697702@pytest .mark .integration
698703@pytest .mark .parametrize ("test_catalog" , CATALOGS )
699704def test_table_name_with_slash (test_catalog : Catalog , table_schema_simple : Schema ) -> None :
700- if isinstance (test_catalog , (HiveCatalog , SqlCatalog , RestCatalog )):
705+ if isinstance (test_catalog , (HiveCatalog , SqlCatalog )):
701706 pytest .skip (f"{ type (test_catalog ).__name__ } does not support slash in table name" )
702707
703708 namespace = ("ns_slash" ,)
@@ -724,7 +729,7 @@ def test_table_name_with_slash(test_catalog: Catalog, table_schema_simple: Schem
724729@pytest .mark .integration
725730@pytest .mark .parametrize ("test_catalog" , CATALOGS )
726731def test_table_name_with_dot (test_catalog : Catalog , table_schema_simple : Schema ) -> None :
727- if isinstance (test_catalog , (HiveCatalog , SqlCatalog , RestCatalog )):
732+ if isinstance (test_catalog , (HiveCatalog , SqlCatalog )):
728733 pytest .skip (f"{ type (test_catalog ).__name__ } does not support dot in table name" )
729734
730735 namespace = ("ns_dot" ,)
0 commit comments