Skip to content

TST: Retyping of categorical column with NaN #60112

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

Conversation

SpoopyPillow
Copy link
Contributor

@SpoopyPillow SpoopyPillow commented Oct 28, 2024

expected = pd.DataFrame({"a": Categorical([1], [1]), "b": [1]})
assert df["a"].dtype == "category"

df.loc[0, "a"] = 1
Copy link
Member

Choose a reason for hiding this comment

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

From the issue, this should test assigning a numpy array with an integer not just an integer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh right, I'll get that changed

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Oct 30, 2024
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

One comment otherwise looks good

Co-authored-by: Matthew Roeschke <[email protected]>
@mroeschke mroeschke added this to the 3.0 milestone Oct 30, 2024
@mroeschke mroeschke merged commit 2a1ca9d into pandas-dev:main Oct 30, 2024
43 of 51 checks passed
@mroeschke
Copy link
Member

Thanks @SpoopyPillow

@SpoopyPillow SpoopyPillow deleted the test_dtype_change_categorical_nan branch October 31, 2024 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: v1.3.0 Introduces Unexpected Retyping of Categorical Column with NaN inside
2 participants