polars/polars-assert-frame-equals
| Rule | polars-assert-frame-equals |
|---|---|
| Pack | Polars |
| Severity | warning |
| Fix | unsafe, with xpd check --fix --unsafe-fixes |
| Library versions | every version |
Polars DataFrame.equals returned True on equal values with Int32 and Int64 columns. Use assert_frame_equal to check dtypes and report the differences.
assert df.equals(other)pl.testing.assert_frame_equal(df, other)What the rule reports
Section titled “What the rule reports”equals returned True. assert_frame_equal raised AssertionError for Int32 against Int64.
How to fix it
Section titled “How to fix it”Use xpd check --fix --unsafe-fixes to rewrite assert df.equals(other) to pl.testing.assert_frame_equal(df, other) after checking the intended result.
Message
Section titled “Message”xpd prints this message with the issue. A name that starts with $ stands for code from your file.
Polars DataFrame.equals returned True on equal values with Int32 and Int64 columns. Use assert_frame_equal to check dtypes and report the differences.Browse the other rules of the Polars pack.