polars/polars-join-asof-unsorted
| Rule | polars-join-asof-unsorted |
|---|---|
| Pack | Polars |
| Severity | info |
| Fix | unsafe, with xpd check --fix --unsafe-fixes |
| Library versions | every version |
An as-of join needs ascending join keys. Check that each input is sorted by the join key within each group.
df.join_asof(other, on="x", check_sortedness=False)df.sort("x").join_asof(other.sort("x"), on="x")What the rule reports
Section titled “What the rule reports”Descending right keys raised InvalidOperationError with the default sortedness check.
How to fix it
Section titled “How to fix it”With --unsafe-fixes, xpd enables the sortedness check. Sort the inputs if their keys are out of order.
Message
Section titled “Message”xpd prints this message with the issue. A name that starts with $ stands for code from your file.
An as-of join needs ascending join keys. Check that each input is sorted by the join key within each group.Browse the other rules of the Polars pack.