MCPcopy
hub / github.com/dask/dask / _maybe_sort

Function _maybe_sort

dask/dataframe/utils.py:496–511  ·  view source on GitHub ↗
(a, check_index: bool)

Source from the content-addressed store, hash-verified

494
495
496def _maybe_sort(a, check_index: bool):
497 from dask.dataframe import methods
498
499 # sort by value, then index
500 try:
501 if is_dataframe_like(a):
502 if set(a.index.names) & set(a.columns):
503 a.index.names = [
504 f"-overlapped-index-name-{i}" for i in range(len(a.index.names))
505 ]
506 a = a.sort_values(by=methods.tolist(a.columns))
507 else:
508 a = a.sort_values()
509 except (TypeError, IndexError, ValueError):
510 pass
511 return a.sort_index() if check_index else a
512
513
514def _maybe_convert_string(a, b):

Callers 1

assert_eqFunction · 0.85

Calls 3

is_dataframe_likeFunction · 0.90
setClass · 0.85
sort_valuesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…