Skip to content

[python] Make write_pandas respect write_cols and add to_duckdb parallelism#8636

Open
TheR1sing3un wants to merge 2 commits into
apache:masterfrom
TheR1sing3un:python-write-pandas-write-cols-duckdb-parallelism
Open

[python] Make write_pandas respect write_cols and add to_duckdb parallelism#8636
TheR1sing3un wants to merge 2 commits into
apache:masterfrom
TheR1sing3un:python-write-pandas-write-cols-duckdb-parallelism

Conversation

@TheR1sing3un

Copy link
Copy Markdown
Member

Purpose

Two small pypaimon read/write consistency fixes:

  • 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. It now builds the batch against the write_cols subset schema when one is set (reusing _write_cols_pyarrow_schema, matching 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/to_arrow.

Tests

New unit/integration tests in table_write_test.py (column-subset and full-column write_pandas) and reader_base_test.py (to_duckdb parallel vs serial parity over a multi-split table).

…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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant