Skip to content

BUG: Fix assert_series_equal for categoricals with nulls and check_category_order=False (#62008) #62011

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

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

Aniketsy
Copy link

Description

This PR fixes an issue where pd.testing.assert_series_equal fails when comparing Series with categorical values containing NaNs when using check_category_order=False.

Problem

When using left.categories.take(left.codes) for comparing category values, null codes (-1) were not handled correctly, causing incorrect comparisons.

Please let me know if my approach or fix needs any improvements . I’m open to feedback and happy to make changes based on suggestions.

Aniketsy added 30 commits July 25, 2025 16:47
@Aniketsy
Copy link
Author

Hi @mroeschke
This PR fixes an issue where pd.testing.assert_series_equal fails when comparing Series with categorical values containing NaNs when using check_category_order=False.

I'd really appreciate it if you could take a look and provide feedback .
Please let me know if anything needs to be improved or clarified.

Thanks!

@Aniketsy
Copy link
Author

Aniketsy commented Aug 1, 2025

Hi @jorisvandenbossche,
Could you please review this PR and let me know if any changes are needed.
Also,I want to ask if the is issue already assigned to someone should I continue working on it or leave it to the current assignee?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant