Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PERF-#5709: Avoid re-putting a distributed Series to the engine's object store at .map() #5704

Merged
merged 4 commits into from
Feb 27, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 won't cast to pandas then the execution engine will try to
dchigarev marked this conversation as resolved.
Show resolved Hide resolved
# 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