[python] Make write_pandas respect write_cols and add to_duckdb parallelism#8636
Open
TheR1sing3un wants to merge 2 commits into
Open
Conversation
…lelism write_pandas built the RecordBatch against the full table schema, so a column-subset write set up via with_write_type raised KeyError on the missing columns -- column-subset writes only worked through write_arrow. Build the batch against the write_cols subset schema when one is set, reusing _write_cols_pyarrow_schema so it matches the write_arrow_batch validation path. Full-column writes are unchanged. to_duckdb now forwards parallelism and blob_parallelism to to_arrow, matching to_pandas and to_arrow.
Empty commit to re-run CI; the previous lint-python (3.10) failure was a flaky concurrent last-writer-wins test unrelated to this change (it passed on 3.11 and 3.6.15).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Two small pypaimon read/write consistency fixes:
write_pandasbuilt the RecordBatch against the full table schema, so a column-subset write set up viawith_write_typeraisedKeyErroron the missing columns — column-subset writes only worked throughwrite_arrow. It now builds the batch against thewrite_colssubset schema when one is set (reusing_write_cols_pyarrow_schema, matching thewrite_arrow_batchvalidation path). Full-column writes are unchanged.to_duckdbnow forwardsparallelismandblob_parallelismtoto_arrow, matchingto_pandas/to_arrow.Tests
New unit/integration tests in
table_write_test.py(column-subset and full-columnwrite_pandas) andreader_base_test.py(to_duckdbparallel vs serial parity over a multi-split table).