polars/polars-assert-frame-equals
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| Polars | warning | unsafe, with xpd check --fix --unsafe-fixes |
All versions |
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.
Diagnostic message
Section titled “Diagnostic message”Polars DataFrame.equals returned True on equal values with Int32 and Int64 columns. Use assert_frame_equal to check dtypes and report the differences.See all rules in the Polars pack.