faisal37990 opened a new pull request, #4631:
URL: https://github.com/apache/iceberg-python/pull/4631
Closes #4165.
### Summary
- Skip parent manifests with no live entries (`not (has_added_files() or
has_existing_files() or added_snapshot_id == self._snapshot_id)`) in
`_OverwriteFiles._existing_manifests`, matching
`_FastAppendFiles._existing_manifests` and Java Iceberg's
`MergingSnapshotProducer.apply`.
- Skip deleted-only parent manifests in `_OverwriteFiles._deleted_entries`
(`_get_entries`) before partition evaluation and Avro entry reads so prior
delete manifests are neither retained nor re-opened on subsequent overwrites.
- Preserves v1 manifests with unknown (`None`) file counts since
`has_added_files()` / `has_existing_files()` return `True` when counts are
`None`, and drops prior deleted-only manifests even across unrelated partitions
by filtering before partition evaluation.
### Testing
- Added 3 regression tests in `tests/table/test_snapshots.py`:
- `test_overwrite_drops_previous_deleted_only_manifests` (5 sequential
explicit overwrites keep manifest count bounded at 2 instead of growing
linearly)
- `test_overwrite_drops_deleted_only_manifests_across_partitions`
(verifies prior deleted-only manifest from partition `a` is dropped when
overwriting partition `b` while preserving `a`'s live manifest)
- `test_overwrite_skips_reading_deleted_only_manifests` (verifies prior
deleted-only manifests are never fetched during subsequent overwrites)
- Verified locally: `pytest tests/table/test_snapshots.py` (61 passed),
`pytest tests/table/test_commit_retry.py` (all passed), `ruff check`, and `ruff
format --check`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]