Skip to content

Commit c52ab6d

Browse files
Corrected pd.merge indicator type hint (#48677)
* 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
1 parent 06e1978 commit c52ab6d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10100,7 +10100,7 @@ def merge(
1010010100
sort: bool = False,
1010110101
suffixes: Suffixes = ("_x", "_y"),
1010210102
copy: bool = True,
10103-
indicator: bool = False,
10103+
indicator: str | bool = False,
1010410104
validate: str | None = None,
1010510105
) -> DataFrame:
1010610106
from pandas.core.reshape.merge import merge

pandas/core/reshape/merge.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def merge(
107107
sort: bool = False,
108108
suffixes: Suffixes = ("_x", "_y"),
109109
copy: bool = True,
110-
indicator: bool = False,
110+
indicator: str | bool = False,
111111
validate: str | None = None,
112112
) -> DataFrame:
113113
op = _MergeOperation(
@@ -625,7 +625,7 @@ class _MergeOperation:
625625
sort: bool
626626
suffixes: Suffixes
627627
copy: bool
628-
indicator: bool
628+
indicator: str | bool
629629
validate: str | None
630630
join_names: list[Hashable]
631631
right_join_keys: list[AnyArrayLike]
@@ -644,7 +644,7 @@ def __init__(
644644
right_index: bool = False,
645645
sort: bool = True,
646646
suffixes: Suffixes = ("_x", "_y"),
647-
indicator: bool = False,
647+
indicator: str | bool = False,
648648
validate: str | None = None,
649649
) -> None:
650650
_left = _validate_operand(left)

0 commit comments

Comments
 (0)