Skip to content

Commit

Permalink
PERF-modin-project#5709: Avoid re-putting a distributed Series to the…
Browse files Browse the repository at this point in the history
… engine's object store at `.map()` (modin-project#5704)

Co-authored-by: Iaroslav Igoshev <[email protected]>
Signed-off-by: Dmitry Chigarev <[email protected]>
  • Loading branch information
dchigarev and YarShev authored Feb 27, 2023
1 parent 3d38d37 commit d724802
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modin/pandas/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,14 @@ def map(self, arg, na_action=None): # noqa: PR01, RT01, D200
"""
Map values of Series according to input correspondence.
"""
if isinstance(arg, type(self)):
# HACK: if we don't cast to pandas, then the execution engine will try to
# propagate the distributed Series to workers and most likely would have
# some performance problems.
# TODO: A better way of doing so could be passing this `arg` as a query compiler
# and broadcast accordingly.
arg = arg._to_pandas()

if not callable(arg) and hasattr(arg, "get"):
mapper = arg

Expand Down

0 comments on commit d724802

Please sign in to comment.