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

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

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:

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