Skip to content

Commit d09e5e1

Browse files
charlesdong1991jbrockmendel
authored andcommitted
DEPR: Deprecate try_sort (pandas-dev#33902)
1 parent 1b958df commit d09e5e1

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

pandas/core/common.py

-8
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,6 @@ def count_not_none(*args) -> int:
200200
return sum(x is not None for x in args)
201201

202202

203-
def try_sort(iterable):
204-
listed = list(iterable)
205-
try:
206-
return sorted(listed)
207-
except TypeError:
208-
return listed
209-
210-
211203
def asarray_tuplesafe(values, dtype=None):
212204

213205
if not (isinstance(values, (list, tuple)) or hasattr(values, "__array__")):

pandas/core/indexes/api.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@ def _sanitize_and_check(indexes):
256256
if list in kinds:
257257
if len(kinds) > 1:
258258
indexes = [
259-
Index(com.try_sort(x)) if not isinstance(x, Index) else x
260-
for x in indexes
259+
Index(list(x)) if not isinstance(x, Index) else x for x in indexes
261260
]
262261
kinds.remove(list)
263262
else:

0 commit comments

Comments
 (0)