Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jorisvandenbossche opened this issue Dec 5, 2023 · 2 comments · Fixed by #56654
Labels
Regression Functionality that used to work in a prior pandas version Testing pandas testing functions or related to the test suite
Milestone

Comments

@jorisvandenbossche
Copy link
Member

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
@jorisvandenbossche jorisvandenbossche added Testing pandas testing functions or related to the test suite Regression Functionality that used to work in a prior pandas version labels Dec 5, 2023
@jorisvandenbossche jorisvandenbossche added this to the 2.2 milestone Dec 5, 2023
@jorisvandenbossche
Copy link
Member Author

Looking at the history of the file, I assume this is related to #55934 (cc @parthi-siva @MarcoGorelli)

I am also seeing a bunch of TODO's and xfails added in that PR?

@lithomas1 lithomas1 added the Blocker Blocking issue or pull request for an upcoming release label Dec 5, 2023
@lithomas1 lithomas1 removed the Blocker Blocking issue or pull request for an upcoming release label Dec 21, 2023
@lithomas1
Copy link
Member

Can we mark this as a dupe of #56131?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Functionality that used to work in a prior pandas version Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants