Skip to content

Commit

Permalink
mars-project#2488 - place suggested fix in sort_values.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaun2h committed Oct 7, 2023
1 parent 0a42ba8 commit 26112a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mars/dataframe/sort/sort_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 26112a4

Please sign in to comment.