dragonknightk opened a new pull request, #4204:
URL: https://github.com/apache/iceberg-python/pull/4204

   Closes #4196
   
   # Rationale for this change
   
   `dynamic_partition_overwrite` built its delete filter from 
`find_field(source_id).name`, which is only the leaf name. For a partition 
sourced from the nested column `s.x`, the filter referenced `x`, so:
   
   - with a top-level `x`, it deleted rows by the wrong column and kept the old 
rows of the replaced partition
   - without one, binding the filter raised `ValueError`
   
   The filter now uses `find_column_name`, the full column name, the same way 
`_determine_partitions` does since #2204 (。•̀ᴗ-)✧
   
   ## Are these changes tested?
   
   Yes. `test_dynamic_partition_overwrite_by_nested_source_column` in 
`tests/table/test_init.py` runs the example from the issue against the memory 
and SQL catalogs:
   
   - with this change, only partition `s.x = 5` is replaced: `[(5, 1), (9, 5)]`
   - without it, the test fails with `[(1, 5), (9, 5)]`
   
   ## Are there any user-facing changes?
   
   Yes, a bug fix: `dynamic_partition_overwrite` replaces the right partitions 
on tables partitioned by a nested column. Tables partitioned only by top-level 
columns behave as before (・ω・)b
   
   ## AI Disclosure
   
   Human-led contribution. Grok Bot, working for dragonknightk, assisted with 
this change. All submitted content was reviewed by a human before submission.
   


-- 
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]

Reply via email to