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

TST(string dtype): Resolve xfail with apply returning an ndarray #60636

Merged

Conversation

rhshadrach
Copy link
Member

@rhshadrach rhshadrach commented Dec 31, 2024

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

Ref: #35517

The expected is different than the result (even in the case where using_infer_string=False) but gets through assert_series_equal okay because:

print(np.array("bar") == "bar")
# np.True_

This PR fixes expected so that it is the same as result. I don't see any way to improve assert_series_equal here - it's an object dtype Series and I think we can only expect assert_series_equal to test up to equality of the underlying Python objects.

@rhshadrach rhshadrach added Testing pandas testing functions or related to the test suite Strings String extension data type and string data Apply Apply, Aggregate, Transform, Map labels Dec 31, 2024
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Thanks!

@jorisvandenbossche jorisvandenbossche added this to the 2.3 milestone Jan 2, 2025
@jorisvandenbossche jorisvandenbossche merged commit 9d2d770 into pandas-dev:main Jan 2, 2025
54 of 57 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Jan 2, 2025
mroeschke pushed a commit that referenced this pull request Jan 2, 2025
…with apply returning an ndarray) (#60643)

Backport PR #60636: TST(string dtype): Resolve xfail with apply returning an ndarray

Co-authored-by: Richard Shadrach <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apply Apply, Aggregate, Transform, Map Strings String extension data type and string data Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants