4343from pyiceberg .table .sorting import INITIAL_SORT_ORDER_ID , SortField , SortOrder
4444from pyiceberg .transforms import BucketTransform , DayTransform , IdentityTransform
4545from pyiceberg .types import IntegerType , LongType , NestedField , TimestampType , UUIDType
46- from tests .conftest import clean_up
46+ from tests .conftest import (
47+ clean_up ,
48+ does_support_atomic_concurrent_updates ,
49+ does_support_dot_in_identifier ,
50+ does_support_nested_namespaces ,
51+ does_support_purge_table ,
52+ does_support_schema_evolution ,
53+ does_support_slash_in_identifier ,
54+ )
4755
4856
4957@pytest .fixture (scope = "function" )
@@ -246,7 +254,7 @@ def test_drop_table(test_catalog: Catalog, table_schema_nested: Schema, table_na
246254@pytest .mark .integration
247255@pytest .mark .parametrize ("test_catalog" , CATALOGS )
248256def test_purge_table (test_catalog : Catalog , table_schema_nested : Schema , table_name : str , database_name : str ) -> None :
249- if not test_catalog . supports_purge_table ( ):
257+ if not does_support_purge_table ( test_catalog ):
250258 pytest .skip ("Catalog does not support purge_table operation" )
251259
252260 identifier = (database_name , table_name )
@@ -299,7 +307,7 @@ def test_update_table_transaction(test_catalog: Catalog, test_schema: Schema, ta
299307@pytest .mark .integration
300308@pytest .mark .parametrize ("test_catalog" , CATALOGS )
301309def test_update_schema_conflict (test_catalog : Catalog , test_schema : Schema , table_name : str , database_name : str ) -> None :
302- if not test_catalog . supports_atomic_concurrent_updates ( ):
310+ if not does_support_atomic_concurrent_updates ( test_catalog ):
303311 pytest .skip ("Catalog does not support atomic concurrent updates" )
304312
305313 identifier = (database_name , table_name )
@@ -646,7 +654,7 @@ def test_rest_custom_namespace_separator(rest_catalog: RestCatalog, table_schema
646654def test_incompatible_partitioned_schema_evolution (
647655 test_catalog : Catalog , test_schema : Schema , test_partition_spec : PartitionSpec , database_name : str , table_name : str
648656) -> None :
649- if not test_catalog . supports_schema_evolution ( ):
657+ if not does_support_schema_evolution ( test_catalog ):
650658 pytest .skip (f"{ type (test_catalog ).__name__ } does not support schema evolution" )
651659
652660 identifier = (database_name , table_name )
@@ -675,7 +683,7 @@ def test_incompatible_partitioned_schema_evolution(
675683@pytest .mark .integration
676684@pytest .mark .parametrize ("test_catalog" , CATALOGS )
677685def test_namespace_with_slash (test_catalog : Catalog ) -> None :
678- if not test_catalog . supports_slash_in_identifier ( ):
686+ if not does_support_slash_in_identifier ( test_catalog ):
679687 pytest .skip (f"{ type (test_catalog ).__name__ } does not support slash in namespace" )
680688
681689 namespace = ("new/db" ,)
@@ -700,7 +708,7 @@ def test_namespace_with_slash(test_catalog: Catalog) -> None:
700708def test_incompatible_sorted_schema_evolution (
701709 test_catalog : Catalog , test_schema : Schema , test_sort_order : SortOrder , database_name : str , table_name : str
702710) -> None :
703- if not test_catalog . supports_schema_evolution ( ):
711+ if not does_support_schema_evolution ( test_catalog ):
704712 pytest .skip (f"{ type (test_catalog ).__name__ } does not support schema evolution" )
705713
706714 identifier = (database_name , table_name )
@@ -720,7 +728,7 @@ def test_incompatible_sorted_schema_evolution(
720728@pytest .mark .integration
721729@pytest .mark .parametrize ("test_catalog" , CATALOGS )
722730def test_namespace_with_dot (test_catalog : Catalog ) -> None :
723- if not test_catalog . supports_dot_in_identifier ( ):
731+ if not does_support_dot_in_identifier ( test_catalog ):
724732 pytest .skip (f"{ type (test_catalog ).__name__ } does not support dot in namespace" )
725733
726734 namespace = ("new.db" ,)
@@ -734,7 +742,7 @@ def test_namespace_with_dot(test_catalog: Catalog) -> None:
734742 assert test_catalog .namespace_exists (namespace )
735743
736744 # Hierarchical catalogs might treat this as multiple levels.
737- if test_catalog . supports_nested_namespaces ( ):
745+ if does_support_nested_namespaces ( test_catalog ):
738746 namespaces = test_catalog .list_namespaces ()
739747 assert ("new" ,) in namespaces or ("new.db" ,) in namespaces
740748 else :
@@ -750,7 +758,7 @@ def test_namespace_with_dot(test_catalog: Catalog) -> None:
750758@pytest .mark .integration
751759@pytest .mark .parametrize ("test_catalog" , CATALOGS )
752760def test_table_name_with_slash (test_catalog : Catalog , table_schema_simple : Schema ) -> None :
753- if not test_catalog . supports_slash_in_identifier ( ):
761+ if not does_support_slash_in_identifier ( test_catalog ):
754762 pytest .skip (f"{ type (test_catalog ).__name__ } does not support slash in table name" )
755763
756764 namespace = ("ns_slash" ,)
@@ -777,7 +785,7 @@ def test_table_name_with_slash(test_catalog: Catalog, table_schema_simple: Schem
777785@pytest .mark .integration
778786@pytest .mark .parametrize ("test_catalog" , CATALOGS )
779787def test_table_name_with_dot (test_catalog : Catalog , table_schema_simple : Schema ) -> None :
780- if not test_catalog . supports_dot_in_identifier ( ):
788+ if not does_support_dot_in_identifier ( test_catalog ):
781789 pytest .skip (f"{ type (test_catalog ).__name__ } does not support dot in table name" )
782790
783791 namespace = ("ns_dot" ,)
0 commit comments