Skip to content

REGR: assert_frame_equal check_dtype=False no longer works for equal values but numpy vs extension dtype #56340

Closed
@jorisvandenbossche

Description

@jorisvandenbossche

Noticed this from the geopandas CI, but on the latest released version, the following works:

df1 = pd.DataFrame({"col": [1, 2, 3]})
df2 = df1.astype("Int64")

# expected error by default 
>>> pd.testing.assert_frame_equal(df1, df2)
...
AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="col") are different
Attribute "dtype" are different
[left]:  int64
[right]: Int64

# but the assertion passes with check_dtype=False
>>> pd.testing.assert_frame_equal(df1, df2, check_dtype=False)

On main we however get the following for this second check:

>>> pd.testing.assert_frame_equal(df1, df2, check_dtype=False)
...
AssertionError: DataFrame.iloc[:, 0] (column name="col") are different

DataFrame.iloc[:, 0] (column name="col") classes are different
[left]:  ndarray
[right]: IntegerArray

Metadata

Metadata

Assignees

No one assigned

    Labels

    RegressionFunctionality that used to work in a prior pandas versionTestingpandas testing functions or related to the test suite

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions