Repository navigation
Commit ceb2d8d
authored
fix: forward write_options when write_parquet receives ParquetWriterOptions (#1761)
`write_parquet` takes `write_options`, documents it and declares it in
the `@overload` for the `ParquetWriterOptions` form, but that branch
calls `write_parquet_with_options(path, compression)` and drops it. The
destination accepts the parameter, so everything in
`DataFrameWriteOptions` (`partition_by`, `single_file_output`,
`insert_operation`, `sort_by`) was silently ignored for that one
spelling.
Measured with the same `DataFrameWriteOptions(partition_by="part")`:
write_parquet(path, ParquetWriterOptions(), write_options=wo)
-> ['IDuOjvMa3pdEDotb_0.parquet'] not partitioned
write_parquet_with_options(path, ParquetWriterOptions(), write_options=wo)
-> ['part=a', 'part=b']
write_parquet(path, "zstd", write_options=wo)
-> ['part=a', 'part=b']
No error and no warning: the files just land in the wrong layout.
The branch arrived in ef62fa8 (#1169) while `write_options` came
earlier in #857, so the new delegation path was written without carrying
the existing parameter over. The same `if` refuses `compression_level`
with an explicit `ValueError`, which shows that arguments incompatible
with this branch get rejected on purpose; `write_options` was not
rejected, only forgotten.1 parent a2ddb55 commit ceb2d8d
2 files changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1621 | 1621 | | |
1622 | 1622 | | |
1623 | 1623 | | |
1624 | | - | |
| 1624 | + | |
1625 | 1625 | | |
1626 | 1626 | | |
1627 | 1627 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2538 | 2538 | | |
2539 | 2539 | | |
2540 | 2540 | | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
2541 | 2560 | | |
2542 | 2561 | | |
2543 | 2562 | | |
| |||
0 commit comments