Skip to content
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

BUG: Fix Series comparison fails when index dtypes differ (object vs string) (#61099) #61199

Closed
wants to merge 15 commits into from

Conversation

MayurKishorKumar
Copy link

@rhshadrach
Copy link
Member

@MayurKishorKumar - looks like your environment got added to your commit.

@MayurKishorKumar
Copy link
Author

Oh shoot, my bad! I’ll fix that right away. Thanks for catching it!

@MayurKishorKumar
Copy link
Author

Hi @rhshadrach 👋

I’m working on fixing [#61099] and ran into a failure in test_mixed_col_index_dtype.

My fix updates Index.equals so that StringDtype and object dtypes are treated as equivalent when comparing column indexes. As a result, this test now fails because result.columns.dtype becomes "string" while expected.columns.dtype remains object.

There are two options I’m considering:

  1. Update the test to explicitly cast expected.columns to "string" when using_infer_string=True, so it reflects the result.
  2. Adjust internal logic so the result stays object, but that might go against the spirit of treating string/object as equal.

Would updating the test be acceptable in this case?

Thanks!

@MayurKishorKumar
Copy link
Author

pre-commit.ci autofix

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.

BUG: Can only compare identically-labeled Series objects (string vs. object)
2 participants