@@ -1135,22 +1135,43 @@ def example_table_metadata_v3() -> Dict[str, Any]:
11351135 return EXAMPLE_TABLE_METADATA_V3
11361136
11371137
1138- @pytest .fixture (scope = "session" )
1139- def table_location (tmp_path_factory : pytest .TempPathFactory ) -> str :
1138+ def generate_table_location_with_version_hint (
1139+ tmp_path_factory : pytest .TempPathFactory , content_in_version_hint : str , metadata_filename : str
1140+ ) -> str :
11401141 from pyiceberg .io .pyarrow import PyArrowFileIO
11411142
1142- metadata_filename = f"{ uuid .uuid4 ()} .metadata.json"
11431143 metadata_location = str (tmp_path_factory .getbasetemp () / "metadata" / metadata_filename )
11441144 version_hint_location = str (tmp_path_factory .getbasetemp () / "metadata" / "version-hint.text" )
11451145 metadata = TableMetadataV2 (** EXAMPLE_TABLE_METADATA_V2 )
11461146 ToOutputFile .table_metadata (metadata , PyArrowFileIO ().new_output (location = metadata_location ), overwrite = True )
11471147
11481148 with PyArrowFileIO ().new_output (location = version_hint_location ).create (overwrite = True ) as s :
1149- s .write (metadata_filename .encode ("utf-8" ))
1149+ s .write (content_in_version_hint .encode ("utf-8" ))
11501150
11511151 return str (tmp_path_factory .getbasetemp ())
11521152
11531153
1154+ @pytest .fixture (scope = "session" )
1155+ def table_location_with_version_hint_full (tmp_path_factory : pytest .TempPathFactory ) -> str :
1156+ content_in_version_hint = str (uuid .uuid4 ())
1157+ metadata_filename = f"{ content_in_version_hint } .metadata.json"
1158+ return generate_table_location_with_version_hint (tmp_path_factory , content_in_version_hint , metadata_filename )
1159+
1160+
1161+ @pytest .fixture (scope = "session" )
1162+ def table_location_with_version_hint_numeric (tmp_path_factory : pytest .TempPathFactory ) -> str :
1163+ content_in_version_hint = "1234567890"
1164+ metadata_filename = f"v{ content_in_version_hint } .metadata.json"
1165+ return generate_table_location_with_version_hint (tmp_path_factory , content_in_version_hint , metadata_filename )
1166+
1167+
1168+ @pytest .fixture (scope = "session" )
1169+ def table_location_with_version_hint_non_numeric (tmp_path_factory : pytest .TempPathFactory ) -> str :
1170+ content_in_version_hint = "non_numberic"
1171+ metadata_filename = f"{ content_in_version_hint } .metadata.json"
1172+ return generate_table_location_with_version_hint (tmp_path_factory , content_in_version_hint , metadata_filename )
1173+
1174+
11541175@pytest .fixture (scope = "session" )
11551176def metadata_location (tmp_path_factory : pytest .TempPathFactory ) -> str :
11561177 from pyiceberg .io .pyarrow import PyArrowFileIO
0 commit comments