@@ -433,9 +433,7 @@ def __repr__(self) -> str:
433433}
434434
435435
436- def data_file_with_partition (
437- partition_type : StructType , format_version : TableVersion , legacy_equality_ids : bool = False
438- ) -> StructType :
436+ def data_file_with_partition (partition_type : StructType , format_version : TableVersion ) -> StructType :
439437 data_file_partition_type = StructType (
440438 * [
441439 NestedField (
@@ -448,32 +446,20 @@ def data_file_with_partition(
448446 ]
449447 )
450448
451- fields = []
452- for field in DATA_FILE_TYPE [format_version ].fields :
453- if field .field_id == 102 :
454- fields .append (
455- NestedField (
456- field_id = 102 ,
457- name = "partition" ,
458- field_type = data_file_partition_type ,
459- required = True ,
460- doc = "Partition data tuple, schema based on the partition spec" ,
461- )
462- )
463- elif field .field_id == 135 and legacy_equality_ids :
464- fields .append (
465- NestedField (
466- field_id = 135 ,
467- name = "equality_ids" ,
468- field_type = ListType (element_id = 136 , element_type = LongType (), element_required = True ),
469- required = False ,
470- doc = "Field ids used to determine row equality in equality delete files." ,
471- )
449+ return StructType (
450+ * [
451+ NestedField (
452+ field_id = 102 ,
453+ name = "partition" ,
454+ field_type = data_file_partition_type ,
455+ required = True ,
456+ doc = "Partition data tuple, schema based on the partition spec" ,
472457 )
473- else :
474- fields .append (field )
475-
476- return StructType (* fields )
458+ if field .field_id == 102
459+ else field
460+ for field in DATA_FILE_TYPE [format_version ].fields
461+ ]
462+ )
477463
478464
479465class DataFile (Record ):
@@ -1072,7 +1058,6 @@ class ManifestWriter(ABC):
10721058 _min_sequence_number : int | None
10731059 _partitions : list [Record ]
10741060 _compression : AvroCompressionCodec
1075- _legacy_equality_ids : bool
10761061
10771062 def __init__ (
10781063 self ,
@@ -1081,7 +1066,6 @@ def __init__(
10811066 output_file : OutputFile ,
10821067 snapshot_id : int ,
10831068 avro_compression : AvroCompressionCodec ,
1084- legacy_equality_ids : bool = False ,
10851069 ) -> None :
10861070 self .closed = False
10871071 self ._spec = spec
@@ -1098,7 +1082,6 @@ def __init__(
10981082 self ._min_sequence_number = None
10991083 self ._partitions = []
11001084 self ._compression = avro_compression
1101- self ._legacy_equality_ids = legacy_equality_ids
11021085
11031086 def __enter__ (self ) -> ManifestWriter :
11041087 """Open the writer."""
@@ -1144,7 +1127,6 @@ def _with_partition(self, format_version: TableVersion) -> Schema:
11441127 data_file_type = data_file_with_partition (
11451128 format_version = format_version ,
11461129 partition_type = self ._spec .partition_type (self ._schema ),
1147- legacy_equality_ids = self ._legacy_equality_ids ,
11481130 )
11491131 return manifest_entry_schema_with_data_file (format_version = format_version , data_file = data_file_type )
11501132
@@ -1257,9 +1239,8 @@ def __init__(
12571239 output_file : OutputFile ,
12581240 snapshot_id : int ,
12591241 avro_compression : AvroCompressionCodec ,
1260- legacy_equality_ids : bool = False ,
12611242 ):
1262- super ().__init__ (spec , schema , output_file , snapshot_id , avro_compression , legacy_equality_ids = legacy_equality_ids )
1243+ super ().__init__ (spec , schema , output_file , snapshot_id , avro_compression )
12631244
12641245 def content (self ) -> ManifestContent :
12651246 return ManifestContent .DATA
@@ -1280,9 +1261,8 @@ def __init__(
12801261 output_file : OutputFile ,
12811262 snapshot_id : int ,
12821263 avro_compression : AvroCompressionCodec ,
1283- legacy_equality_ids : bool = False ,
12841264 ):
1285- super ().__init__ (spec , schema , output_file , snapshot_id , avro_compression , legacy_equality_ids = legacy_equality_ids )
1265+ super ().__init__ (spec , schema , output_file , snapshot_id , avro_compression )
12861266
12871267 def content (self ) -> ManifestContent :
12881268 return ManifestContent .DATA
@@ -1314,12 +1294,11 @@ def write_manifest(
13141294 output_file : OutputFile ,
13151295 snapshot_id : int ,
13161296 avro_compression : AvroCompressionCodec ,
1317- legacy_equality_ids : bool = False ,
13181297) -> ManifestWriter :
13191298 if format_version == 1 :
1320- return ManifestWriterV1 (spec , schema , output_file , snapshot_id , avro_compression , legacy_equality_ids = legacy_equality_ids )
1299+ return ManifestWriterV1 (spec , schema , output_file , snapshot_id , avro_compression )
13211300 elif format_version == 2 :
1322- return ManifestWriterV2 (spec , schema , output_file , snapshot_id , avro_compression , legacy_equality_ids = legacy_equality_ids )
1301+ return ManifestWriterV2 (spec , schema , output_file , snapshot_id , avro_compression )
13231302 else :
13241303 raise ValueError (f"Cannot write manifest for table version: { format_version } " )
13251304
0 commit comments