Skip to content

Commit 543a2af

Browse files
committed
Adapt V3 manifest writers to the V3 manifest list schema now on main
1 parent 7637601 commit 543a2af

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

pyiceberg/manifest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,8 @@ def to_manifest_file(self) -> ManifestFile:
13991399
field.name: value
14001400
for field, value in zip(MANIFEST_LIST_FILE_SCHEMAS[DEFAULT_READ_VERSION].fields, manifest_file._data, strict=True)
14011401
}
1402-
return ManifestFile.from_args(_table_format_version=3, first_row_id=self._first_row_id, **args)
1402+
args["first_row_id"] = self._first_row_id
1403+
return ManifestFile.from_args(_table_format_version=3, **args)
14031404

14041405
def new_writer(self) -> AvroOutputFile[ManifestEntry]:
14051406
# Use the V3 record layout so the V3-only data file fields are written

tests/avro/test_file.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,11 @@ def test_todict_manifest_file_v2_layout_matches_fastavro() -> None:
264264
"""todict must exclude ManifestFile's V3-only first_row_id for a record bound to the V2 layout,
265265
266266
the same way it does for DataFile, otherwise the exclusion added for DataFile would be
267-
inconsistent for other record types with version-dependent trailing fields.
267+
inconsistent for other record types with version-dependent trailing fields. The binding is
268+
explicit because the default read version is V3, whose layout does carry first_row_id.
268269
"""
269270
manifest_file = ManifestFile.from_args(
271+
_table_format_version=2,
270272
manifest_path="/manifests/m1.avro",
271273
manifest_length=100,
272274
partition_spec_id=0,

0 commit comments

Comments
 (0)