Skip to content

TST: Ensure dtypes are set correctly for empty integer columns #24386 #34886

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

Merged
merged 6 commits into from
Jun 20, 2020
6 changes: 6 additions & 0 deletions pandas/tests/dtypes/test_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,3 +991,9 @@ def test_is_dtype_no_warning(check):

with tm.assert_produces_warning(None):
check(data["A"])


def test_check_dtype_empty_column():
# GH24386: Ensure dtypes are set correctly for empty integer columns
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add to the comment "dictionary data with non-overlapping columns, resulting in an empty DataFrame", as it is specifically this case (not just an empty dataframe)

data = pd.DataFrame({"a": [1, 2]}, columns=["b"], dtype=int)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also pls parameterize over the dtypes mentioned in the OP

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in test_constructors.py there are already similar tests, please move near them

assert data.b.dtype == np.dtype("int")