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
5 changes: 5 additions & 0 deletions pandas/tests/dtypes/test_dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,3 +991,8 @@ def test_is_dtype_no_warning(check):

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


def test_check_dtype_empty_column():
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 is np.dtype("int")