From 26112a48ebe75f3d34b0661998e4dc09d2ccddd7 Mon Sep 17 00:00:00 2001 From: Shaun2h Date: Sat, 7 Oct 2023 22:54:38 +0800 Subject: [PATCH] #2488 - place suggested fix in sort_values.py --- mars/dataframe/sort/sort_values.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mars/dataframe/sort/sort_values.py b/mars/dataframe/sort/sort_values.py index ae8cdb9bf1..bd40416cee 100644 --- a/mars/dataframe/sort/sort_values.py +++ b/mars/dataframe/sort/sort_values.py @@ -111,7 +111,10 @@ def execute(cls, ctx, op: "DataFrameSortValues"): def __call__(self, a): assert self.axis == 0 if self.ignore_index: - index_value = parse_index(pd.RangeIndex(a.shape[0])) + if type(a.shape[0]) != int: + index_value = parse_index(pd.RangeIndex(-1)) + else: + index_value = parse_index(pd.RangeIndex(a.shape[0])) else: if isinstance(a.index_value.value, IndexValue.RangeIndex): index_value = parse_index(pd.Index([], dtype=np.int64))