polars/polars-streaming-order
| Rule | polars-streaming-order |
|---|---|
| Pack | Polars |
| Severity | info |
| Fix | none, edit by hand |
| Library versions | Polars 2.0 and later |
Polars 2.0 made streaming the default for lazy queries. Sort on the keys that define the required order before taking a positional slice.
lf.unpivot(on=["x", "y"]).head(2).collect()lf.unpivot(on=["x", "y"]).sort("variable", "value").head(2).collect()What the rule reports
Section titled “What the rule reports”The first two unpivoted rows had labels b and c with streaming and b and b with the in-memory engine.
How to fix it
Section titled “How to fix it”Edit the code using the replacement in the example.
Message
Section titled “Message”xpd prints this message with the issue. A name that starts with $ stands for code from your file.
Polars 2.0 made streaming the default for lazy queries. Sort on the keys that define the required order before taking a positional slice.Browse the other rules of the Polars pack.