Skip to content

TST/bug: add test for NaT in Categorical.isin with empty string #51587

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 3 commits into from
Feb 24, 2023

Conversation

topper-123
Copy link
Contributor

This bug was present in pandas v1.5, but is not present in v2.0.rc1. I added a test for this working as expected now.

@simonjayhawkins simonjayhawkins added the Testing pandas testing functions or related to the test suite label Feb 23, 2023
@simonjayhawkins
Copy link
Member

This bug was present in pandas v1.5, but is not present in v2.0.rc1. I added a test for this working as expected now.

Thanks. Looking at the date of the issue, the bug was present before 1.5.

Things may have changed since I took a break, but we don't normally add a release note when we just add a regression test.

Any idea which PR fixed the issue?

@phofl
Copy link
Member

phofl commented Feb 23, 2023

No whatsnew note, this is still correct

@topper-123
Copy link
Contributor Author

Any idea which PR fixed the issue?

No, I just tried the code snippet in the issue and saw that the problem is gone. Then I tried it in v1.5, where it was still present :-).

In v1.5 I also got a warning, when I ran the snippet (FutureWarning: Inferring timedelta64[ns] from data containing strings is deprecated and will be removed in a future version. To retain the old behavior explicitly pass Series(data, dtype=timedelta64[ns])), so my guess is whatever fixed that warning, also fixed this, but that's just a guess.

I could do a bisect, but IMO that's probably not worth it...

@simonjayhawkins
Copy link
Member

I could do a bisect, but IMO that's probably not worth it...

no problem. The reason I asked is that the PR that fixed may have had a release note and the issue number could have been appended instead of adding the release note here.

@topper-123
Copy link
Contributor Author

Yeah, I looked through the whatsnew to find canditates and found several candidates and figured it wasn't worth it to figure which one it was...

I've removed the whatsnew entry in the newest commit.

@mroeschke mroeschke added this to the 2.1 milestone Feb 24, 2023
@mroeschke mroeschke merged commit 87fd6fd into pandas-dev:main Feb 24, 2023
@mroeschke
Copy link
Member

Thanks @topper-123

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: Categorical series .isin({pd.NaT, ...}) gives all-False
4 participants