From 8d51763b4fb492a96f14629eef1656fd1c1fc820 Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Tue, 21 Oct 2025 21:46:32 +1100 Subject: [PATCH 01/16] Fix: proper return types for MultiIndex.swaplevel & MultiIndex.union --- pandas-stubs/core/indexes/multi.pyi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandas-stubs/core/indexes/multi.pyi b/pandas-stubs/core/indexes/multi.pyi index e66c845ec..5a4b55431 100644 --- a/pandas-stubs/core/indexes/multi.pyi +++ b/pandas-stubs/core/indexes/multi.pyi @@ -7,6 +7,7 @@ from collections.abc import ( from typing import ( final, overload, + Any ) import numpy as np @@ -135,7 +136,7 @@ class MultiIndex(Index): def append(self, other): ... def repeat(self, repeats, axis=...): ... def drop(self, codes, level: Level | None = None, errors: str = "raise") -> Self: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride] - def swaplevel(self, i: int = -2, j: int = -1): ... + def swaplevel(self, i: int = -2, j: int = -1) -> Self: ... def reorder_levels(self, order): ... def sortlevel( self, @@ -163,3 +164,7 @@ class MultiIndex(Index): def insert(self, loc, item): ... def delete(self, loc): ... def isin(self, values, level=...) -> np_1darray[np.bool]: ... + @overload + def union(self, other: MultiIndex, sort: bool | None = ...) -> MultiIndex: ... + @overload + def union(self, other: Index | list[HashableT], sort: bool | None = ...) -> Index[Any]: ... From 4552867c27891ddbc81aa755223734468cc0c468 Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Wed, 22 Oct 2025 23:13:15 +1100 Subject: [PATCH 02/16] Index of and List of tuples in MultiIndex overriding --- pandas-stubs/_typing.pyi | 5 ++++- pandas-stubs/core/indexes/multi.pyi | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pandas-stubs/_typing.pyi b/pandas-stubs/_typing.pyi index 7d944d243..3d2b1715b 100644 --- a/pandas-stubs/_typing.pyi +++ b/pandas-stubs/_typing.pyi @@ -904,7 +904,10 @@ SeriesDType: TypeAlias = ( | datetime.datetime # includes pd.Timestamp | datetime.timedelta # includes pd.Timedelta ) -S1 = TypeVar("S1", bound=SeriesDType, default=Any) + +IndexKey: TypeAlias = SeriesDType | tuple[Hashable, ...] # to support Indexes of tuples for MultiIndex unions + +S1 = TypeVar("S1", bound=IndexKey, default=Any) # Like S1, but without `default=Any`. S2 = TypeVar("S2", bound=SeriesDType) S2_CT = TypeVar("S2_CT", bound=SeriesDType, contravariant=True) diff --git a/pandas-stubs/core/indexes/multi.pyi b/pandas-stubs/core/indexes/multi.pyi index 5a4b55431..6cc71e1d0 100644 --- a/pandas-stubs/core/indexes/multi.pyi +++ b/pandas-stubs/core/indexes/multi.pyi @@ -7,7 +7,6 @@ from collections.abc import ( from typing import ( final, overload, - Any ) import numpy as np @@ -165,6 +164,6 @@ class MultiIndex(Index): def delete(self, loc): ... def isin(self, values, level=...) -> np_1darray[np.bool]: ... @overload - def union(self, other: MultiIndex, sort: bool | None = ...) -> MultiIndex: ... + def union(self, other: MultiIndex | Index[tuple[Hashable, ...]] | list[tuple[Hashable, ...]], sort: bool | None = None,) -> Self: ... @overload - def union(self, other: Index | list[HashableT], sort: bool | None = ...) -> Index[Any]: ... + def union(self, other: list[HashableT] | Index, sort: bool | None = None,) -> Index: ... From d3f575761310e0a62ef93322ca68f9617b8500f3 Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Wed, 22 Oct 2025 23:13:31 +1100 Subject: [PATCH 03/16] MultiIndex union tests --- tests/indexes/test_indexes.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/indexes/test_indexes.py b/tests/indexes/test_indexes.py index 4db44276d..60cd1f30b 100644 --- a/tests/indexes/test_indexes.py +++ b/tests/indexes/test_indexes.py @@ -1613,3 +1613,33 @@ def test_to_series() -> None: np.complexfloating, ) check(assert_type(Index(["1"]).to_series(), "pd.Series[str]"), pd.Series, str) + +def test_multiindex_union() -> None: + """Test that union returns MultiIndex on MultiIndex input""" + mi = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=["let", "num"]) + mi2 = pd.MultiIndex.from_product([["a", "b"], [3, 4]], names=["let", "num"]) + + check( + assert_type(mi.union(mi2), "pd.MultiIndex"), + pd.MultiIndex, + ) + check( + assert_type(mi.union(pd.Index([("c", 3), ("d", 4)])), "pd.MultiIndex"), + pd.MultiIndex, + ) + check( + assert_type(mi.union([("c", 3), ("d", 4)]), "pd.MultiIndex"), + pd.MultiIndex, + ) + check( + assert_type(mi.union(pd.Index([1, 2, 3])), "pd.Index"), + pd.Index + ) + check( + assert_type(mi.union(pd.Index(["x", "y"])), "pd.Index"), + pd.Index + ) + check( + assert_type(mi.union([1, 2, 3]), "pd.Index"), + pd.Index + ) \ No newline at end of file From d401e0ca9e30c32d63c00735f847581290750652 Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Thu, 23 Oct 2025 00:18:06 +1100 Subject: [PATCH 04/16] MultiIndex-Index union overload simplified --- pandas-stubs/core/indexes/multi.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas-stubs/core/indexes/multi.pyi b/pandas-stubs/core/indexes/multi.pyi index 6cc71e1d0..e02521409 100644 --- a/pandas-stubs/core/indexes/multi.pyi +++ b/pandas-stubs/core/indexes/multi.pyi @@ -164,6 +164,6 @@ class MultiIndex(Index): def delete(self, loc): ... def isin(self, values, level=...) -> np_1darray[np.bool]: ... @overload - def union(self, other: MultiIndex | Index[tuple[Hashable, ...]] | list[tuple[Hashable, ...]], sort: bool | None = None,) -> Self: ... + def union(self, other: Self | Index | list[tuple[Hashable, ...]], sort: bool | None = ...,) -> Self: ... @overload - def union(self, other: list[HashableT] | Index, sort: bool | None = None,) -> Index: ... + def union(self, other: Index | list[HashableT], sort: bool | None = ...,) -> Index: ... From 7739015d34c436dd3b1605c801d30e02c306c2e2 Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Thu, 23 Oct 2025 00:25:05 +1100 Subject: [PATCH 05/16] MultiIndex test amended and swaplevel test added --- tests/indexes/test_indexes.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/indexes/test_indexes.py b/tests/indexes/test_indexes.py index 60cd1f30b..0fcd272ff 100644 --- a/tests/indexes/test_indexes.py +++ b/tests/indexes/test_indexes.py @@ -1614,6 +1614,14 @@ def test_to_series() -> None: ) check(assert_type(Index(["1"]).to_series(), "pd.Series[str]"), pd.Series, str) +def test_swaplevel_rettype() -> None: + """Test that swaplevel returns Self""" + mi = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=["let", "num"]) + check( + assert_type(mi.swaplevel(0, 1), "pd.MultiIndex"), + pd.MultiIndex, + ) + def test_multiindex_union() -> None: """Test that union returns MultiIndex on MultiIndex input""" mi = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=["let", "num"]) @@ -1631,14 +1639,6 @@ def test_multiindex_union() -> None: assert_type(mi.union([("c", 3), ("d", 4)]), "pd.MultiIndex"), pd.MultiIndex, ) - check( - assert_type(mi.union(pd.Index([1, 2, 3])), "pd.Index"), - pd.Index - ) - check( - assert_type(mi.union(pd.Index(["x", "y"])), "pd.Index"), - pd.Index - ) check( assert_type(mi.union([1, 2, 3]), "pd.Index"), pd.Index From 2a77d799aee7c68567590da0ed38ef97e5688394 Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Thu, 23 Oct 2025 01:05:05 +1100 Subject: [PATCH 06/16] Simplified MultiIndex-Index union overload --- pandas-stubs/core/indexes/multi.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas-stubs/core/indexes/multi.pyi b/pandas-stubs/core/indexes/multi.pyi index e02521409..c040bea12 100644 --- a/pandas-stubs/core/indexes/multi.pyi +++ b/pandas-stubs/core/indexes/multi.pyi @@ -164,6 +164,6 @@ class MultiIndex(Index): def delete(self, loc): ... def isin(self, values, level=...) -> np_1darray[np.bool]: ... @overload - def union(self, other: Self | Index | list[tuple[Hashable, ...]], sort: bool | None = ...,) -> Self: ... + def union(self, other: Self | list[tuple[Hashable, ...]], sort: bool | None = ...,) -> Self: ... @overload def union(self, other: Index | list[HashableT], sort: bool | None = ...,) -> Index: ... From 2f5c33854c8676d0778cb0fc2d7d9904c3454b2d Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Thu, 23 Oct 2025 01:05:55 +1100 Subject: [PATCH 07/16] Reverted S1 changes --- pandas-stubs/_typing.pyi | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pandas-stubs/_typing.pyi b/pandas-stubs/_typing.pyi index 3d2b1715b..5a5fe5bbb 100644 --- a/pandas-stubs/_typing.pyi +++ b/pandas-stubs/_typing.pyi @@ -905,9 +905,7 @@ SeriesDType: TypeAlias = ( | datetime.timedelta # includes pd.Timedelta ) -IndexKey: TypeAlias = SeriesDType | tuple[Hashable, ...] # to support Indexes of tuples for MultiIndex unions - -S1 = TypeVar("S1", bound=IndexKey, default=Any) +S1 = TypeVar("S1", bound=SeriesDType, default=Any) # Like S1, but without `default=Any`. S2 = TypeVar("S2", bound=SeriesDType) S2_CT = TypeVar("S2_CT", bound=SeriesDType, contravariant=True) From 5e82ee56b2b03c0290e98e28c3db7d5bf3ba9d63 Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Thu, 23 Oct 2025 01:06:26 +1100 Subject: [PATCH 08/16] amended MultiIndex union test and added swaplevel test --- tests/indexes/test_indexes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/indexes/test_indexes.py b/tests/indexes/test_indexes.py index 0fcd272ff..16d528729 100644 --- a/tests/indexes/test_indexes.py +++ b/tests/indexes/test_indexes.py @@ -1632,8 +1632,8 @@ def test_multiindex_union() -> None: pd.MultiIndex, ) check( - assert_type(mi.union(pd.Index([("c", 3), ("d", 4)])), "pd.MultiIndex"), - pd.MultiIndex, + assert_type(mi.union(pd.Index([("c", 3), ("d", 4)])), "pd.Index"), + pd.Index, ) check( assert_type(mi.union([("c", 3), ("d", 4)]), "pd.MultiIndex"), From a606e96bc83e8fd09ded8a486b095cf689b805b3 Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Thu, 23 Oct 2025 01:28:16 +1100 Subject: [PATCH 09/16] Removed runtime-failing test --- tests/indexes/test_indexes.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/indexes/test_indexes.py b/tests/indexes/test_indexes.py index 16d528729..79bbf0cd2 100644 --- a/tests/indexes/test_indexes.py +++ b/tests/indexes/test_indexes.py @@ -1614,6 +1614,7 @@ def test_to_series() -> None: ) check(assert_type(Index(["1"]).to_series(), "pd.Series[str]"), pd.Series, str) + def test_swaplevel_rettype() -> None: """Test that swaplevel returns Self""" mi = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=["let", "num"]) @@ -1622,6 +1623,7 @@ def test_swaplevel_rettype() -> None: pd.MultiIndex, ) + def test_multiindex_union() -> None: """Test that union returns MultiIndex on MultiIndex input""" mi = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=["let", "num"]) @@ -1632,14 +1634,10 @@ def test_multiindex_union() -> None: pd.MultiIndex, ) check( - assert_type(mi.union(pd.Index([("c", 3), ("d", 4)])), "pd.Index"), + assert_type(mi.union(pd.Index([("c", 3), ("d", 4)])), "pd.Index"), pd.Index, ) check( assert_type(mi.union([("c", 3), ("d", 4)]), "pd.MultiIndex"), pd.MultiIndex, ) - check( - assert_type(mi.union([1, 2, 3]), "pd.Index"), - pd.Index - ) \ No newline at end of file From 46e805082a5619df89cdcba84cce0af524c6c2cb Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Thu, 23 Oct 2025 09:14:55 +1100 Subject: [PATCH 10/16] Pre-commit refactoring --- pandas-stubs/core/indexes/multi.pyi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pandas-stubs/core/indexes/multi.pyi b/pandas-stubs/core/indexes/multi.pyi index c040bea12..c93926022 100644 --- a/pandas-stubs/core/indexes/multi.pyi +++ b/pandas-stubs/core/indexes/multi.pyi @@ -164,6 +164,14 @@ class MultiIndex(Index): def delete(self, loc): ... def isin(self, values, level=...) -> np_1darray[np.bool]: ... @overload - def union(self, other: Self | list[tuple[Hashable, ...]], sort: bool | None = ...,) -> Self: ... + def union( + self, + other: Self | list[tuple[Hashable, ...]], + sort: bool | None = ..., + ) -> Self: ... @overload - def union(self, other: Index | list[HashableT], sort: bool | None = ...,) -> Index: ... + def union( + self, + other: Index | list[HashableT], + sort: bool | None = ..., + ) -> Index: ... From 092eec2096dd9d7009f8f83a0d674cea7cc9c0a6 Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Thu, 23 Oct 2025 09:19:57 +1100 Subject: [PATCH 11/16] Removed a MultiIndex-Index test --- tests/indexes/test_indexes.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/indexes/test_indexes.py b/tests/indexes/test_indexes.py index 9ff37f10b..6a427ae2b 100644 --- a/tests/indexes/test_indexes.py +++ b/tests/indexes/test_indexes.py @@ -1621,10 +1621,6 @@ def test_multiindex_union() -> None: assert_type(mi.union(mi2), "pd.MultiIndex"), pd.MultiIndex, ) - check( - assert_type(mi.union(pd.Index([("c", 3), ("d", 4)])), "pd.Index"), - pd.Index, - ) check( assert_type(mi.union([("c", 3), ("d", 4)]), "pd.MultiIndex"), pd.MultiIndex, From 6b676bf303394bbc39244393b3992f48d80d37d9 Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Thu, 23 Oct 2025 09:32:00 +1100 Subject: [PATCH 12/16] Removed MultiIndex union overloading --- pandas-stubs/core/indexes/multi.pyi | 9 +-------- pandas-stubs/py.typed | 0 tests/indexes/test_indexes.py | 13 ++++--------- 3 files changed, 5 insertions(+), 17 deletions(-) delete mode 100644 pandas-stubs/py.typed diff --git a/pandas-stubs/core/indexes/multi.pyi b/pandas-stubs/core/indexes/multi.pyi index c93926022..519ef92d6 100644 --- a/pandas-stubs/core/indexes/multi.pyi +++ b/pandas-stubs/core/indexes/multi.pyi @@ -163,15 +163,8 @@ class MultiIndex(Index): def insert(self, loc, item): ... def delete(self, loc): ... def isin(self, values, level=...) -> np_1darray[np.bool]: ... - @overload def union( self, - other: Self | list[tuple[Hashable, ...]], + other: Self | Index | list[HashableT], sort: bool | None = ..., ) -> Self: ... - @overload - def union( - self, - other: Index | list[HashableT], - sort: bool | None = ..., - ) -> Index: ... diff --git a/pandas-stubs/py.typed b/pandas-stubs/py.typed deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/indexes/test_indexes.py b/tests/indexes/test_indexes.py index 6a427ae2b..6fc27f719 100644 --- a/tests/indexes/test_indexes.py +++ b/tests/indexes/test_indexes.py @@ -1603,20 +1603,15 @@ def test_to_series() -> None: check(assert_type(Index(["1"]).to_series(), "pd.Series[str]"), pd.Series, str) -def test_swaplevel_rettype() -> None: - """Test that swaplevel returns Self""" +def test_multiindex_swaplevel_rettype() -> None: + """Test that union returns MultiIndex on MultiIndex input and swaplevel returns Self""" mi = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=["let", "num"]) + mi2 = pd.MultiIndex.from_product([["a", "b"], [3, 4]], names=["let", "num"]) + check( assert_type(mi.swaplevel(0, 1), "pd.MultiIndex"), pd.MultiIndex, ) - - -def test_multiindex_union() -> None: - """Test that union returns MultiIndex on MultiIndex input""" - mi = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=["let", "num"]) - mi2 = pd.MultiIndex.from_product([["a", "b"], [3, 4]], names=["let", "num"]) - check( assert_type(mi.union(mi2), "pd.MultiIndex"), pd.MultiIndex, From 5d8153f66d57365d643e87cf3351845f58edd8eb Mon Sep 17 00:00:00 2001 From: Zach Brownjohn <166975079+realzachbrownjohn@users.noreply.github.com> Date: Fri, 24 Oct 2025 09:25:21 +1100 Subject: [PATCH 13/16] Separated swaplevel and union tests Co-authored-by: Yi-Fan Wang --- tests/indexes/test_indexes.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/indexes/test_indexes.py b/tests/indexes/test_indexes.py index 6fc27f719..b5031ea04 100644 --- a/tests/indexes/test_indexes.py +++ b/tests/indexes/test_indexes.py @@ -1603,20 +1603,22 @@ def test_to_series() -> None: check(assert_type(Index(["1"]).to_series(), "pd.Series[str]"), pd.Series, str) -def test_multiindex_swaplevel_rettype() -> None: - """Test that union returns MultiIndex on MultiIndex input and swaplevel returns Self""" +def test_multiindex_union() -> None: + """Test that MultiIndex.union returns MultiIndex""" mi = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=["let", "num"]) mi2 = pd.MultiIndex.from_product([["a", "b"], [3, 4]], names=["let", "num"]) check( - assert_type(mi.swaplevel(0, 1), "pd.MultiIndex"), - pd.MultiIndex, + assert_type(mi.union(mi2), "pd.MultiIndex"), pd.MultiIndex ) check( - assert_type(mi.union(mi2), "pd.MultiIndex"), - pd.MultiIndex, + assert_type(mi.union([("c", 3), ("d", 4)]), "pd.MultiIndex"), pd.MultiIndex ) + + +def test_multiindex_swaplevel() -> None: + """Test that MultiIndex.swaplevel returns MultiIndex""" + mi = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=["let", "num"]) check( - assert_type(mi.union([("c", 3), ("d", 4)]), "pd.MultiIndex"), - pd.MultiIndex, + assert_type(mi.swaplevel(0, 1), "pd.MultiIndex"), pd.MultiIndex ) From 3397d49dc91ca20c0f32766f4351a136c5123b33 Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Fri, 24 Oct 2025 09:31:33 +1100 Subject: [PATCH 14/16] test for MultiIndex-Index union --- tests/indexes/test_indexes.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/indexes/test_indexes.py b/tests/indexes/test_indexes.py index b5031ea04..d477572ee 100644 --- a/tests/indexes/test_indexes.py +++ b/tests/indexes/test_indexes.py @@ -1608,17 +1608,12 @@ def test_multiindex_union() -> None: mi = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=["let", "num"]) mi2 = pd.MultiIndex.from_product([["a", "b"], [3, 4]], names=["let", "num"]) - check( - assert_type(mi.union(mi2), "pd.MultiIndex"), pd.MultiIndex - ) - check( - assert_type(mi.union([("c", 3), ("d", 4)]), "pd.MultiIndex"), pd.MultiIndex - ) + check(assert_type(mi.union(mi2), "pd.MultiIndex"), pd.MultiIndex) + check(assert_type(mi.union([("c", 3), ("d", 4)]), "pd.MultiIndex"), pd.MultiIndex) + check(assert_type(mi.union([1, 2, 3]), "pd.MultiIndex"), pd.MultiIndex) + - def test_multiindex_swaplevel() -> None: """Test that MultiIndex.swaplevel returns MultiIndex""" mi = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=["let", "num"]) - check( - assert_type(mi.swaplevel(0, 1), "pd.MultiIndex"), pd.MultiIndex - ) + check(assert_type(mi.swaplevel(0, 1), "pd.MultiIndex"), pd.MultiIndex) From 39877b29c57e3c29a7220f4cd99b43e1356c91f2 Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Fri, 24 Oct 2025 09:51:22 +1100 Subject: [PATCH 15/16] MultiIndex.union overload replaced with change of base return type --- pandas-stubs/core/indexes/base.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas-stubs/core/indexes/base.pyi b/pandas-stubs/core/indexes/base.pyi index d6b245983..3ff4db49a 100644 --- a/pandas-stubs/core/indexes/base.pyi +++ b/pandas-stubs/core/indexes/base.pyi @@ -405,7 +405,7 @@ class Index(IndexOpsMixin[S1], ElementOpsMixin[S1]): __bool__ = ... def union( self, other: list[HashableT] | Self, sort: bool | None = None - ) -> Index: ... + ) -> Self: ... def intersection( self, other: list[S1] | Self, sort: bool | None = False ) -> Self: ... From 9c662991ef5801da220efc8ddc3bafa1909db5ea Mon Sep 17 00:00:00 2001 From: Zach Brownjohn Date: Fri, 24 Oct 2025 09:54:01 +1100 Subject: [PATCH 16/16] removed MultiIndex.union overload --- pandas-stubs/core/indexes/multi.pyi | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pandas-stubs/core/indexes/multi.pyi b/pandas-stubs/core/indexes/multi.pyi index 519ef92d6..7dc76e7f7 100644 --- a/pandas-stubs/core/indexes/multi.pyi +++ b/pandas-stubs/core/indexes/multi.pyi @@ -163,8 +163,3 @@ class MultiIndex(Index): def insert(self, loc, item): ... def delete(self, loc): ... def isin(self, values, level=...) -> np_1darray[np.bool]: ... - def union( - self, - other: Self | Index | list[HashableT], - sort: bool | None = ..., - ) -> Self: ...