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

API(str dtype): Raise on StringDtype for unary op + #60710

Merged
merged 6 commits into from
Jan 22, 2025

Conversation

rhshadrach
Copy link
Member

  • 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.

Python strings, NumPy string arrays, object dtype, and StringDtype backed by Python all raise for this op.

@rhshadrach rhshadrach added Numeric Operations Arithmetic, Comparison, and Logical operations Strings String extension data type and string data API - Consistency Internal Consistency of API/Behavior labels Jan 13, 2025
@rhshadrach rhshadrach added this to the 2.3 milestone Jan 13, 2025
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, looks good!

@@ -4,6 +4,7 @@
import re
from typing import (
TYPE_CHECKING,
Never,
Copy link
Member

Choose a reason for hiding this comment

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

This is probably too new? (some CI is failing on this import)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

Still gives some typing error ...

pandas/core/arrays/string_arrow.py:484: error: Return type "None" of "__pos__" incompatible with
return type "ArrowStringArray" in supertype "ArrowExtensionArray"  [override]

Copy link
Member

Choose a reason for hiding this comment

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

It seems others are typed as def __pos__(self) -> Self:

@jorisvandenbossche jorisvandenbossche merged commit 1bb264c into pandas-dev:main Jan 22, 2025
54 checks passed
Copy link

lumberbot-app bot commented Jan 22, 2025

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 2.3.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 1bb264c443f6be64ac28ff9afc0341eed0bcc455
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #60710: API(str dtype): Raise on StringDtype for unary op +'
  1. Push to a named branch:
git push YOURFORK 2.3.x:auto-backport-of-pr-60710-on-2.3.x
  1. Create a PR against branch 2.3.x, I would have named this PR:

"Backport PR #60710 on branch 2.3.x (API(str dtype): Raise on StringDtype for unary op +)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

@jorisvandenbossche
Copy link
Member

Manual backport -> #60763

asharmalik19 pushed a commit to asharmalik19/pandas that referenced this pull request Jan 22, 2025
mroeschke pushed a commit that referenced this pull request Jan 22, 2025
…60710) (#60763)

API(str dtype): Raise on StringDtype for unary op + (#60710)

(cherry picked from commit 1bb264c)

Co-authored-by: Richard Shadrach <[email protected]>
@rhshadrach rhshadrach deleted the str_xfail_unary_pos branch January 23, 2025 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior Numeric Operations Arithmetic, Comparison, and Logical operations Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants