Skip to content

Commit 658c012

Browse files
lliangyu-linFokko
andauthored
Update condition
Co-authored-by: Fokko Driesprong <fokko@apache.org>
1 parent d3bd228 commit 658c012

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pyiceberg/table/update/snapshot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,8 @@ def _compute_deletes(self) -> Tuple[List[ManifestFile], List[ManifestEntry], boo
405405
def _copy_with_new_status(entry: ManifestEntry, status: ManifestEntryStatus) -> ManifestEntry:
406406
return ManifestEntry.from_args(
407407
status=status,
408-
snapshot_id=self.snapshot_id if status != ManifestEntryStatus.EXISTING else entry.snapshot_id,
408+
# When a file is replaced or deleted from the dataset, its manifest entry fields store the snapshot ID in which the file was deleted and status 2 (deleted).
409+
snapshot_id=self.snapshot_id if status == ManifestEntryStatus.DELETED else entry.snapshot_id,
409410
sequence_number=entry.sequence_number,
410411
file_sequence_number=entry.file_sequence_number,
411412
data_file=entry.data_file,

0 commit comments

Comments
 (0)