Skip to content

Commit 7dbaa4d

Browse files
CLN: fixed typing issue
1 parent 8d8e7f9 commit 7dbaa4d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pandas/core/indexes/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4524,7 +4524,7 @@ def asof_locs(self, where, mask):
45244524

45254525
return result
45264526

4527-
def sort_values(self, return_indexer=False, ascending=True, key : Callable = None):
4527+
def sort_values(self, return_indexer=False, ascending=True, key : Union[Callable, None] = None):
45284528
"""
45294529
Return a sorted copy of the index.
45304530
@@ -4537,7 +4537,7 @@ def sort_values(self, return_indexer=False, ascending=True, key : Callable = Non
45374537
Should the indices that would sort the index be returned.
45384538
ascending : bool, default True
45394539
Should the index values be sorted in an ascending order.
4540-
key : Callable, default None
4540+
key : Union[Callable, None] , default None
45414541
Apply a key function to the indices before sorting, like sorted.
45424542
45434543
Returns

pandas/core/series.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3378,9 +3378,9 @@ def sort_index(
33783378

33793379
# Check monotonic-ness before sort an index
33803380
# GH11080
3381-
if ((ascending and index.is_monotonic_increasing) or (
3381+
if (ascending and index.is_monotonic_increasing) or (
33823382
not ascending and index.is_monotonic_decreasing
3383-
)) and key is None:
3383+
):
33843384
if inplace:
33853385
return
33863386
else:

0 commit comments

Comments
 (0)