Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
inline function
  • Loading branch information
kevinjqliu committed Jun 24, 2024
commit f274ef983c4f56fdfd8938353878ec019dcf11ed
5 changes: 1 addition & 4 deletions pyiceberg/table/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,8 @@ def serialize_current_snapshot_id(self, current_snapshot_id: Optional[int]) -> O
@field_serializer("snapshots")
def serialize_snapshots(self, snapshots: List[Snapshot]) -> List[Snapshot]:
# Snapshot field `sequence-number` should not be written for v1 metadata
def exclude_sequence_number(snapshot: Snapshot) -> Snapshot:
return snapshot.model_copy(update={"sequence_number": None})

if self.format_version == 1:
return [exclude_sequence_number(snapshot) for snapshot in snapshots]
return [snapshot.model_copy(update={"sequence_number": None}) for snapshot in snapshots]
return snapshots


Expand Down