Skip to content

df.convert_dtypes() raising new error in Pandas 1.2.0 #247

@westernguy2

Description

@westernguy2

After updating to Pandas 1.2.0, the below test in test_pandas is now failing

df = pytest.college_df
cdf = df.convert_dtypes()
cdf._repr_html_()
assert list(cdf.recommendation.keys()) == ["Correlation", "Distribution", "Occurrence"]

It raises TypeError: data type not understood when the cdf is displayed with _repr_html_.

This test works in Pandas 1.1 but fails in Pandas 1.2 .

In the documentation for convert_dtypes, we see:

Changed in version 1.2: Starting with pandas 1.2, this method also converts float columns to the nullable floating extension type.

This new change could be potentially causing the bug.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtestAdding or Modifying test classes

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions