docs: document that Expr output method kwargs are backend-specific - #12085
docs: document that Expr output method kwargs are backend-specific#12085fbossiere wants to merge 1 commit into
Conversation
The expression-level to_csv/to_parquet/to_parquet_dir/to_delta methods dispatch to the backend, so their **kwargs are whatever that backend's writer accepts -- not unconditionally the PyArrow writer's arguments. DuckDB's to_csv takes DuckDB CSV writer options and DuckDB/PySpark override to_parquet, to_parquet_dir and to_delta as well, so the old wording was wrong on the default backend. Describe kwargs as backend-specific (matching to_json) and keep the PyArrow/deltalake references in a Notes section as the default implementation's behaviour. Resolves ibis-project#11769
|
@fbossiere Thanks for the interest in contributing! Looks reasonable at a glance, but can you first look at the docs preview (I've run it on https://github.com/ibis-project/ibis/actions/runs/32811654581/job/97691967925?pr=12085) and ensure it renders as expected on the base classes as well as the backends? Some screenshots from the docs build wouldn't hurt. I'll take a proper look after that sanity check! |
|
Thanks for the quick look, @deepyaman! Two things: the rendering check you asked for, and a heads-up about the preview link.
|


Description of changes
Table.to_csvdocuments its**kwargsas "Additional keyword arguments passed to pyarrow.csv.CSVWriter", but the expression-level method just dispatches to the backend:Only the default
BaseBackendimplementation goes through PyArrow.BackendDuckDB.to_csvoverrides it and documents its ownkwargsas "DuckDB CSV writer arguments" — and DuckDB is the default backend, so the documented PyArrow contract is wrong on the most common path.The same shape applies to the sibling output methods, so this PR fixes the whole class rather than just the reported method:
Exprmethodto_csvto_parquetto_parquet_dirto_deltaFor each of the four,
**kwargsis now described as "Additional, backend-specific keyword arguments." — the wordingto_jsonalready uses, and which #11769 asks for. The PyArrow /deltalakereferences are not dropped: they move into aNotessection as the default implementation's behaviour, with a pointer to the backend's own method. This follows the precedent of #8623 (to_deltakwargs docs).to_jsonandto_xlsxalready described their kwargs correctly and are left alone.Testing
Documentation-only change — no executable behaviour is modified, so there is no regression test to add. Verified:
ruff check --force-exclude ibis/expr/types/core.py→ passesruff format --force-exclude --check ibis/expr/types/core.py→ already formattedcodespell ibis/expr/types/core.py→ cleanast.get_docstringto confirm the numpydoc sections are well-formed;Notesis placed beforeExamples, matchingto_xlsxin the same filehttps://delta-io.github.io/delta-rs/api/delta_writer/) returns HTTP 200, for the lychee link checkDeliberately left out
to_json/to_xlsx, whose wording is already correct.Issues closed