Skip to content

BUG: pandas.testing.assert_frame_equal with check_dtype=False unexpectedly raises an exception #37609

Closed
@augustin-barillec

Description

@augustin-barillec

This code

import pandas
from datetime import datetime
df1 = pandas.DataFrame({'a': []}) 
df2 = pandas.DataFrame({'a': []})
df1['a'] = pandas.to_datetime(df1['a'])
pandas.testing.assert_frame_equal(df1, df2, check_dtype=False)

raises:

AssertionError: right is not an ExtensionArray

But should it raise instead no exception as df1 and df2 are identical, except for their dtypes ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDtype ConversionsUnexpected or buggy dtype conversionsTestingpandas 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