Skip to content
Next Next commit
TYP:Add typing for pandas.core.frame.dropna
Fixes GH38948.
  • Loading branch information
rbpatt2019 committed Jan 5, 2021
commit 5d24561fefe2ac52456aa10bc4cb4192aa46d815
6 changes: 3 additions & 3 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -5074,10 +5074,10 @@ def dropna(
self,
axis: Axis = 0,
how: str = "any",
thresh=None,
subset=None,
thresh Optional[int] = None,
subset: Optional[Union[Hashable, Sequence[Hashable]]] = None,
inplace: bool = False,
):
) -> Optional[DataFrame]:
Copy link
Member

Choose a reason for hiding this comment

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

I see you used #37137 as a example. However the motivation for that PR was to remove an assert df is not None from the codebase and the return type of Optional[DataFrame] not touched.

Not needed to be done in this PR, but just FYI if the motivation for adding the types is for the public api, then the return type should be the same type as self for subclassed DataFrames.

"""
Remove missing values.

Expand Down