ENH: .merge
- specify string literals for .merge
how
keyword
#48503
Labels
Enhancement
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Typing
type annotations, mypy/pyright type checking
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
The
how
keyword forDataFrame.merge
is typed as a string - which means that type checkers can miss potential errors, as it only accepts a subset of strings ("inner", "outer", "left", "right", "cross").Feature Description
pandas._typing
: add aMergeHow
type, specifying the string literals thathow
acceptspandas.core.frame
:how
as accepting an argument of typeMergeHow
Alternative Solutions
Alternatively we could specify the string literals in the
merge
method function headerAdditional Context
Related PR for
pandas-stubs
The text was updated successfully, but these errors were encountered: