Skip to content

Add type to arg of series/drop-duplicates #40910

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

Conversation

olgarithms
Copy link
Contributor

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

I noticed in #40867 that keep didn't specify a type, so adding it here.

@olgarithms
Copy link
Contributor Author

@MarcoGorelli if you can have a look, I don't think I can assign the PR :)

@MarcoGorelli MarcoGorelli self-requested a review April 13, 2021 08:58
@MarcoGorelli MarcoGorelli added the Typing type annotations, mypy/pyright type checking label Apr 13, 2021
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Nice, thanks @olgarithms !

Can we be more precise? How about

keep: Literal['first', 'last', False]

where Literal will have to be imported as

if TYPE_CHECKING:
    from typing import Literal

(because it's not available in py37)

@jreback jreback added this to the 1.3 milestone Apr 13, 2021
@jreback
Copy link
Contributor

jreback commented Apr 13, 2021

Nice, thanks @olgarithms !

Can we be more precise? How about

keep: Literal['first', 'last', False]

where Literal will have to be imported as

if TYPE_CHECKING:
    from typing import Literal

(because it's not available in py37)

you can define this in pandas._typing as we use keep in a number of places

@simonjayhawkins
Copy link
Member

@olgarithms can you address comments

@olgarithms
Copy link
Contributor Author

Hi, yes! I am going to work on it this weekend!

@simonjayhawkins
Copy link
Member

@olgarithms closing to clear queue. ping if you would like to continue working in this, and i'll reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants