diff --git a/pyiceberg/manifest.py b/pyiceberg/manifest.py index 4e1bab32bb..960952d02d 100644 --- a/pyiceberg/manifest.py +++ b/pyiceberg/manifest.py @@ -408,43 +408,39 @@ def _wrap( self, new_status: ManifestEntryStatus, new_snapshot_id: Optional[int], - new_data_sequence_number: Optional[int], + new_sequence_number: Optional[int], new_file_sequence_number: Optional[int], new_file: DataFile, ) -> ManifestEntry: self.status = new_status self.snapshot_id = new_snapshot_id - self.data_sequence_number = new_data_sequence_number + self.sequence_number = new_sequence_number self.file_sequence_number = new_file_sequence_number self.data_file = new_file return self def _wrap_append( - self, new_snapshot_id: Optional[int], new_data_sequence_number: Optional[int], new_file: DataFile + self, new_snapshot_id: Optional[int], new_sequence_number: Optional[int], new_file: DataFile ) -> ManifestEntry: - return self._wrap(ManifestEntryStatus.ADDED, new_snapshot_id, new_data_sequence_number, None, new_file) + return self._wrap(ManifestEntryStatus.ADDED, new_snapshot_id, new_sequence_number, None, new_file) def _wrap_delete( self, new_snapshot_id: Optional[int], - new_data_sequence_number: Optional[int], + new_sequence_number: Optional[int], new_file_sequence_number: Optional[int], new_file: DataFile, ) -> ManifestEntry: - return self._wrap( - ManifestEntryStatus.DELETED, new_snapshot_id, new_data_sequence_number, new_file_sequence_number, new_file - ) + return self._wrap(ManifestEntryStatus.DELETED, new_snapshot_id, new_sequence_number, new_file_sequence_number, new_file) def _wrap_existing( self, new_snapshot_id: Optional[int], - new_data_sequence_number: Optional[int], + new_sequence_number: Optional[int], new_file_sequence_number: Optional[int], new_file: DataFile, ) -> ManifestEntry: - return self._wrap( - ManifestEntryStatus.EXISTING, new_snapshot_id, new_data_sequence_number, new_file_sequence_number, new_file - ) + return self._wrap(ManifestEntryStatus.EXISTING, new_snapshot_id, new_sequence_number, new_file_sequence_number, new_file) PARTITION_FIELD_SUMMARY_TYPE = StructType( @@ -821,10 +817,8 @@ def add_entry(self, entry: ManifestEntry) -> ManifestWriter: return self def add(self, entry: ManifestEntry) -> ManifestWriter: - if entry.data_sequence_number is not None and entry.data_sequence_number >= 0: - self.add_entry( - self._reused_entry_wrapper._wrap_append(self._snapshot_id, entry.data_sequence_number, entry.data_file) - ) + if entry.sequence_number is not None and entry.sequence_number >= 0: + self.add_entry(self._reused_entry_wrapper._wrap_append(self._snapshot_id, entry.sequence_number, entry.data_file)) else: self.add_entry(self._reused_entry_wrapper._wrap_append(self._snapshot_id, None, entry.data_file)) return self @@ -832,7 +826,7 @@ def add(self, entry: ManifestEntry) -> ManifestWriter: def delete(self, entry: ManifestEntry) -> ManifestWriter: self.add_entry( self._reused_entry_wrapper._wrap_delete( - self._snapshot_id, entry.data_sequence_number, entry.file_sequence_number, entry.data_file + self._snapshot_id, entry.sequence_number, entry.file_sequence_number, entry.data_file ) ) return self @@ -840,7 +834,7 @@ def delete(self, entry: ManifestEntry) -> ManifestWriter: def existing(self, entry: ManifestEntry) -> ManifestWriter: self.add_entry( self._reused_entry_wrapper._wrap_existing( - entry.snapshot_id, entry.data_sequence_number, entry.file_sequence_number, entry.data_file + entry.snapshot_id, entry.sequence_number, entry.file_sequence_number, entry.data_file ) ) return self diff --git a/pyiceberg/table/__init__.py b/pyiceberg/table/__init__.py index 88100d9648..4080f3a05e 100644 --- a/pyiceberg/table/__init__.py +++ b/pyiceberg/table/__init__.py @@ -3353,7 +3353,7 @@ def _copy_with_new_status(entry: ManifestEntry, status: ManifestEntryStatus) -> return ManifestEntry( status=status, snapshot_id=entry.snapshot_id, - data_sequence_number=entry.data_sequence_number, + sequence_number=entry.sequence_number, file_sequence_number=entry.file_sequence_number, data_file=entry.data_file, ) @@ -3537,7 +3537,7 @@ def _existing_manifests(self) -> List[ManifestFile]: ManifestEntry( status=ManifestEntryStatus.EXISTING, snapshot_id=entry.snapshot_id, - data_sequence_number=entry.data_sequence_number, + sequence_number=entry.sequence_number, file_sequence_number=entry.file_sequence_number, data_file=entry.data_file, )