fix: dynamic_partition_overwrite builds per-spec delete predicates after partition spec evolution by tusharchou · Pull Request #3149 · apache/iceberg-python

@tusharchou

…s after partition spec evolution

Fixes apache#3148

When a table has undergone partition spec evolution, its snapshot may
contain manifests written under different partition_spec_ids. Previously,
dynamic_partition_overwrite built the delete predicate using only the
current spec, causing the manifest evaluator to incorrectly skip manifests
from older specs — leaving stale data files silently behind.

The fix builds the delete predicate per historical spec present in the
snapshot, projecting the new data files' partition values into each spec's
coordinate space before evaluating.

Regression tests added covering:
- Mixed-spec snapshot (manifests from both spec-0 and spec-1)
- Overwrite of a partition that only exists in spec-0 manifests (silent
  data duplication case)