Skip to content

Commit

Permalink
PERF-#6671: don't iterate over the result of the 'Series.tolist' func…
Browse files Browse the repository at this point in the history
…tion (#6672)

Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev authored Oct 31, 2023
1 parent fab8bfd commit 3ebbf96
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modin/core/storage_formats/base/query_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ def default_to_pandas(self, pandas_op, *args, **kwargs):
warnings.filterwarnings("ignore", category=FutureWarning)
result = pandas_op(try_cast_to_pandas(self), *args, **kwargs)
if isinstance(result, (tuple, list)):
if "Series.tolist" in pandas_op.__name__:
# fast path: no need to iterate over the result from `tolist` function
return result
return [self.__wrap_in_qc(obj) for obj in result]
return self.__wrap_in_qc(result)

Expand Down

0 comments on commit 3ebbf96

Please sign in to comment.