Skip to content

Add string methods removeprefix and removesuffix #8886

Closed

Description

@jorloplaz

Since Pandas 1.4.0 release (see issue pandas-dev/pandas#36944), two new string methods are available, as a result of Python 3.9 incorporating them as native str methods:

So this issue is about adding these methods to Dask (which should be quite straightforward).

As a temporary workaround, they should be marked explicitly as NotImplemented, the same way it's done for .str.get_dummies (see line below):

_not_implemented = {"get_dummies"}

Please note: if we want to be compatible with Python < 3.9 or Pandas < 1.4, the implementation shouldn't rely on the standard library's existence of these two methods. For example, in Python 3.8 they weren't implemented yet.

Activity

  1. added
    needs triage
    on Apr 6, 2022
  2. added
    good second issue
    feature
    and removed
    needs triage
    on Apr 6, 2022
  3. jrbourbeau commented on Apr 6, 2022

    @jrbourbeau
    Member

    Thanks @jorloplaz -- I agree this would be a nice addition. Is this something you're interested in working on?

  4. jorloplaz commented on Apr 7, 2022

    @jorloplaz
    ContributorAuthor

    I'll see what I can do. This'd be my 1st issue and you tagged it as a good 2nd one, but I think I can manage.

  5. jorloplaz commented on Apr 12, 2022

    @jorloplaz
    ContributorAuthor

    PR created @jrbourbeau and @jsignell . If we required pandas >= 1.4 this would have been really trivial, but as we don't, I had to make sure it works with pandas < 1.4, which requires some manual work.

    Hope it's decent enough!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dataframefeaturegood second issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions