Skip to content

polars/polars-collect-then-write

Pack Severity Fix Versions
Polars info unsafe, with xpd check --fix --unsafe-fixes All versions

Collect builds a DataFrame before writing. Use a matching sink when only the file is needed.

lf.collect().write_parquet("data.parquet")
lf.sink_parquet("data.parquet")

Eager write and streaming sink produced equal data after reading their files.

Use xpd check --fix --unsafe-fixes to replace .collect().write_* with the matching .sink_* call when collect takes no arguments.

Collect builds a DataFrame before writing. Use a matching sink when only the file is needed.

See all rules in the Polars pack.