Skip to content

Commit

Permalink
Corrected pd.merge indicator type hint (pandas-dev#48677)
Browse files Browse the repository at this point in the history
* Corrected pd.merge indicator type hint

https://pandas.pydata.org/docs/reference/api/pandas.merge.html
It should be "str | bool" instead of just string

* Update merge.py

fixed type hint in merge.py

* Update merge.py

Update indicator type hint in _MergeOperation

* Update merge.py

Added type hint _MergeOperation init
  • Loading branch information
PabloRuizCuevas authored and noatamir committed Nov 9, 2022
1 parent f344df8 commit aaf4a3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -10100,7 +10100,7 @@ def merge(
sort: bool = False,
suffixes: Suffixes = ("_x", "_y"),
copy: bool = True,
indicator: bool = False,
indicator: str | bool = False,
validate: str | None = None,
) -> DataFrame:
from pandas.core.reshape.merge import merge
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def merge(
sort: bool = False,
suffixes: Suffixes = ("_x", "_y"),
copy: bool = True,
indicator: bool = False,
indicator: str | bool = False,
validate: str | None = None,
) -> DataFrame:
op = _MergeOperation(
Expand Down Expand Up @@ -625,7 +625,7 @@ class _MergeOperation:
sort: bool
suffixes: Suffixes
copy: bool
indicator: bool
indicator: str | bool
validate: str | None
join_names: list[Hashable]
right_join_keys: list[AnyArrayLike]
Expand All @@ -644,7 +644,7 @@ def __init__(
right_index: bool = False,
sort: bool = True,
suffixes: Suffixes = ("_x", "_y"),
indicator: bool = False,
indicator: str | bool = False,
validate: str | None = None,
) -> None:
_left = _validate_operand(left)
Expand Down

0 comments on commit aaf4a3f

Please sign in to comment.