54
54
ensure_object ,
55
55
is_bool ,
56
56
is_bool_dtype ,
57
- is_extension_array_dtype ,
58
57
is_float_dtype ,
59
58
is_integer ,
60
59
is_integer_dtype ,
@@ -1611,8 +1610,8 @@ def _validate(self, validate: str) -> None:
1611
1610
1612
1611
1613
1612
def get_join_indexers (
1614
- left_keys ,
1615
- right_keys ,
1613
+ left_keys : list [ AnyArrayLike ] ,
1614
+ right_keys : list [ AnyArrayLike ] ,
1616
1615
sort : bool = False ,
1617
1616
how : MergeHow | Literal ["asof" ] = "inner" ,
1618
1617
** kwargs ,
@@ -1621,8 +1620,8 @@ def get_join_indexers(
1621
1620
1622
1621
Parameters
1623
1622
----------
1624
- left_keys : ndarray, Index, Series
1625
- right_keys : ndarray, Index, Series
1623
+ left_keys : list[ ndarray, ExtensionArray, Index, Series]
1624
+ right_keys : list[ ndarray, ExtensionArray, Index, Series]
1626
1625
sort : bool, default False
1627
1626
how : {'inner', 'outer', 'left', 'right'}, default 'inner'
1628
1627
@@ -2062,11 +2061,11 @@ def _get_merge_keys(
2062
2061
def _get_join_indexers (self ) -> tuple [npt .NDArray [np .intp ], npt .NDArray [np .intp ]]:
2063
2062
"""return the join indexers"""
2064
2063
2065
- def flip (xs ) -> np .ndarray :
2064
+ def flip (xs : list [ AnyArrayLike ] ) -> np .ndarray :
2066
2065
"""unlike np.transpose, this returns an array of tuples"""
2067
2066
2068
- def injection (obj ):
2069
- if not is_extension_array_dtype (obj ):
2067
+ def injection (obj : AnyArrayLike ):
2068
+ if not isinstance (obj . dtype , ExtensionDtype ):
2070
2069
# ndarray
2071
2070
return obj
2072
2071
obj = extract_array (obj )
@@ -2213,7 +2212,7 @@ def injection(obj):
2213
2212
2214
2213
2215
2214
def _get_multiindex_indexer (
2216
- join_keys , index : MultiIndex , sort : bool
2215
+ join_keys : list [ AnyArrayLike ] , index : MultiIndex , sort : bool
2217
2216
) -> tuple [npt .NDArray [np .intp ], npt .NDArray [np .intp ]]:
2218
2217
# left & right join labels and num. of levels at each location
2219
2218
mapped = (
@@ -2250,7 +2249,7 @@ def _get_multiindex_indexer(
2250
2249
2251
2250
2252
2251
def _get_single_indexer (
2253
- join_key , index : Index , sort : bool = False
2252
+ join_key : AnyArrayLike , index : Index , sort : bool = False
2254
2253
) -> tuple [npt .NDArray [np .intp ], npt .NDArray [np .intp ]]:
2255
2254
left_key , right_key , count = _factorize_keys (join_key , index ._values , sort = sort )
2256
2255
@@ -2295,7 +2294,7 @@ def _get_no_sort_one_missing_indexer(
2295
2294
2296
2295
2297
2296
def _left_join_on_index (
2298
- left_ax : Index , right_ax : Index , join_keys , sort : bool = False
2297
+ left_ax : Index , right_ax : Index , join_keys : list [ AnyArrayLike ] , sort : bool = False
2299
2298
) -> tuple [Index , npt .NDArray [np .intp ] | None , npt .NDArray [np .intp ]]:
2300
2299
if isinstance (right_ax , MultiIndex ):
2301
2300
left_indexer , right_indexer = _get_multiindex_indexer (
@@ -2316,8 +2315,8 @@ def _left_join_on_index(
2316
2315
2317
2316
2318
2317
def _factorize_keys (
2319
- lk : ArrayLike ,
2320
- rk : ArrayLike ,
2318
+ lk : AnyArrayLike ,
2319
+ rk : AnyArrayLike ,
2321
2320
sort : bool = True ,
2322
2321
how : MergeHow | Literal ["asof" ] = "inner" ,
2323
2322
) -> tuple [npt .NDArray [np .intp ], npt .NDArray [np .intp ], int ]:
@@ -2328,9 +2327,9 @@ def _factorize_keys(
2328
2327
2329
2328
Parameters
2330
2329
----------
2331
- lk : array-like
2330
+ lk : ndarray, ExtensionArray, Index, or Series
2332
2331
Left key.
2333
- rk : array-like
2332
+ rk : ndarray, ExtensionArray, Index, or Series
2334
2333
Right key.
2335
2334
sort : bool, defaults to True
2336
2335
If True, the encoding is done such that the unique elements in the
0 commit comments