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

REF (string): move ArrowStringArrayNumpySemantics methods to base class #59501

Merged
merged 8 commits into from
Aug 15, 2024

Conversation

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

@@ -734,7 +734,14 @@ def _cmp_method(self, other, op) -> ArrowExtensionArray:
raise NotImplementedError(
f"{op.__name__} not implemented for {type(other)}"
)
return ArrowExtensionArray(result)
result = ArrowExtensionArray(result)
if self.dtype.na_value is np.nan: # type: ignore[comparison-overlap]
Copy link
Member

Choose a reason for hiding this comment

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

Semantically wouldn't this be better defined in ArrowStringArray? Since self.dtype must not be a ArrowDtype here

Copy link
Member Author

Choose a reason for hiding this comment

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

either way works; i preferred this since it was maximally high in the inheritance chain

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I would prefer this in ArrowStringArray since this logic is specific to that subclass.

@mroeschke mroeschke added Refactor Internal refactoring of code Strings String extension data type and string data labels Aug 14, 2024
@mroeschke mroeschke added this to the 3.0 milestone Aug 15, 2024
@mroeschke mroeschke merged commit 8bece71 into pandas-dev:main Aug 15, 2024
47 checks passed
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the ref-stringarray-pyarrow-1 branch August 15, 2024 20:34
@jorisvandenbossche jorisvandenbossche modified the milestones: 3.0, 2.3 Aug 20, 2024
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 22, 2024
…ss (pandas-dev#59501)

* REF: move ArrowStringArrayNumpySemantics methods to parent class

* REF: move methods to ArrowStringArray

* mypy fixup

* Fix incorrect double-unpacking

* move methods to subclass
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 22, 2024
…ss (pandas-dev#59501)

* REF: move ArrowStringArrayNumpySemantics methods to parent class

* REF: move methods to ArrowStringArray

* mypy fixup

* Fix incorrect double-unpacking

* move methods to subclass
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 22, 2024
…ss (pandas-dev#59501)

* REF: move ArrowStringArrayNumpySemantics methods to parent class

* REF: move methods to ArrowStringArray

* mypy fixup

* Fix incorrect double-unpacking

* move methods to subclass
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 22, 2024
…ss (pandas-dev#59501)

* REF: move ArrowStringArrayNumpySemantics methods to parent class

* REF: move methods to ArrowStringArray

* mypy fixup

* Fix incorrect double-unpacking

* move methods to subclass
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Aug 27, 2024
…ss (pandas-dev#59501)

* REF: move ArrowStringArrayNumpySemantics methods to parent class

* REF: move methods to ArrowStringArray

* mypy fixup

* Fix incorrect double-unpacking

* move methods to subclass
WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Sep 20, 2024
…ss (pandas-dev#59501)

* REF: move ArrowStringArrayNumpySemantics methods to parent class

* REF: move methods to ArrowStringArray

* mypy fixup

* Fix incorrect double-unpacking

* move methods to subclass
jorisvandenbossche pushed a commit to WillAyd/pandas that referenced this pull request Oct 2, 2024
…ss (pandas-dev#59501)

* REF: move ArrowStringArrayNumpySemantics methods to parent class

* REF: move methods to ArrowStringArray

* mypy fixup

* Fix incorrect double-unpacking

* move methods to subclass
jorisvandenbossche pushed a commit to WillAyd/pandas that referenced this pull request Oct 2, 2024
…ss (pandas-dev#59501)

* REF: move ArrowStringArrayNumpySemantics methods to parent class

* REF: move methods to ArrowStringArray

* mypy fixup

* Fix incorrect double-unpacking

* move methods to subclass
jorisvandenbossche pushed a commit to WillAyd/pandas that referenced this pull request Oct 3, 2024
…ss (pandas-dev#59501)

* REF: move ArrowStringArrayNumpySemantics methods to parent class

* REF: move methods to ArrowStringArray

* mypy fixup

* Fix incorrect double-unpacking

* move methods to subclass
jorisvandenbossche pushed a commit to WillAyd/pandas that referenced this pull request Oct 7, 2024
…ss (pandas-dev#59501)

* REF: move ArrowStringArrayNumpySemantics methods to parent class

* REF: move methods to ArrowStringArray

* mypy fixup

* Fix incorrect double-unpacking

* move methods to subclass
jorisvandenbossche pushed a commit that referenced this pull request Oct 9, 2024
…ss (#59501)

* REF: move ArrowStringArrayNumpySemantics methods to parent class

* REF: move methods to ArrowStringArray

* mypy fixup

* Fix incorrect double-unpacking

* move methods to subclass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Refactor Internal refactoring of code Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants