Skip to content

Conversation

rchen152
Copy link
Contributor

This adds overloads so that a type checker can determine whether drop_duplicates returns DataFrame or None based on the value of the inplace argument.

The motivation for this is that we're using a type checker that looks at the pandas source code for type information. I realize that we should be using the stubs instead, but this will unblock us in the meantime and seems like an improvement to the type annotations anyway.

rchen152 added 2 commits July 27, 2023 14:35
This adds overloads so that a type checker can determine whether
drop_duplicates returns DataFrame or None based on the value of the
`inplace` argument.
@twoertwein twoertwein added the Typing type annotations, mypy/pyright type checking label Jul 28, 2023
@twoertwein twoertwein merged commit ed25532 into pandas-dev:main Jul 28, 2023
@twoertwein
Copy link
Member

Thank you @rchen152!

@rchen152 rchen152 deleted the drop_duplicates_overloads branch July 28, 2023 18:21
@rchen152
Copy link
Contributor Author

Thanks for the quick review and merge :)

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.

2 participants