Skip to content

Refactor StringMethods for extension arrays #36216

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

Closed
TomAugspurger opened this issue Sep 8, 2020 · 0 comments · Fixed by #36357
Closed

Refactor StringMethods for extension arrays #36216

TomAugspurger opened this issue Sep 8, 2020 · 0 comments · Fixed by #36357
Labels
ExtensionArray Extending pandas with custom dtypes or arrays. Refactor Internal refactoring of code Strings String extension data type and string data
Milestone

Comments

@TomAugspurger
Copy link
Contributor

This is an issue to track a refactor of StringMethods that'll be necessary for ArrowStringArray to use pyarrow compute algorithms.

We'll need to update StringMethods

  1. Extract the array from the Series / Index
  2. Dispatch the string methods
  3. Wrap the result

So in my proposal, we'll have something like

class StringMethods:
    def __init__(self, data, ...):
        self._array = data.array
        ...

    def upper(self):
        return self._wrap_result(self._array._str.upper())

cc @xhochy. I have a branch started and will hopefully finish it off this week.

@TomAugspurger TomAugspurger added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 8, 2020
@TomAugspurger TomAugspurger changed the title Refactor StringMethods Refactor StringMethods for extension ararys Sep 8, 2020
@TomAugspurger TomAugspurger changed the title Refactor StringMethods for extension ararys Refactor StringMethods for extension arrays Sep 8, 2020
@TomAugspurger TomAugspurger added Strings String extension data type and string data Refactor Internal refactoring of code ExtensionArray Extending pandas with custom dtypes or arrays. and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 8, 2020
@TomAugspurger TomAugspurger added this to the 2.0 milestone Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ExtensionArray Extending pandas with custom dtypes or arrays. Refactor Internal refactoring of code Strings String extension data type and string data
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant