polars/polars-collect-then-lazy
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| Polars | info | unsafe, with xpd check --fix --unsafe-fixes |
All versions |
Collect executes this query before lazy starts a new plan. Keep the operations in one plan when they can run together.
lf.collect().lazy()lfWhat the rule reports
Section titled “What the rule reports”The collect call produced a DataFrame and lazy returned a new LazyFrame.
How to fix it
Section titled “How to fix it”Use xpd check --fix --unsafe-fixes to drop .collect().lazy() when collect takes no arguments.
Diagnostic message
Section titled “Diagnostic message”Collect executes this query before lazy starts a new plan. Keep the operations in one plan when they can run together.See all rules in the Polars pack.