(a, check_index: bool)
| 494 | |
| 495 | |
| 496 | def _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 | |
| 514 | def _maybe_convert_string(a, b): |
no test coverage detected
searching dependent graphs…