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

FIX-#2688: Update ray.ObjectID to ray.ObjectRef for Ray 2.0 #2695

Merged
merged 2 commits into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion modin/engines/ray/pandas_on_ray/frame/axis_partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, list_of_blocks, bind_ip=False):
self.list_of_ips = [obj.ip for obj in list_of_blocks]

partition_type = PandasOnRayFramePartition
instance_type = ray.ObjectID
instance_type = ray.ObjectRef

@classmethod
def deploy_axis_func(
Expand Down
12 changes: 6 additions & 6 deletions modin/engines/ray/pandas_on_ray/frame/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

class PandasOnRayFramePartition(BaseFramePartition):
def __init__(self, object_id, length=None, width=None, ip=None, call_queue=None):
assert type(object_id) is ray.ObjectID
assert type(object_id) is ray.ObjectRef

self.oid = object_id
if call_queue is None:
Expand All @@ -50,7 +50,7 @@ def get(self):
def apply(self, func, **kwargs):
"""Apply a function to the object stored in this partition.

Note: It does not matter if func is callable or an ObjectID. Ray will
Note: It does not matter if func is callable or an ObjectRef. Ray will
handle it correctly either way. The keyword arguments are sent as a
dictionary.

Expand Down Expand Up @@ -155,7 +155,7 @@ def preprocess_func(cls, func):
func: The function to preprocess.

Returns:
A ray.ObjectID.
A ray.ObjectRef.
"""
return ray.put(func)

Expand All @@ -167,7 +167,7 @@ def length(self):
self._length_cache, self._width_cache = get_index_and_columns.remote(
self.oid
)
if isinstance(self._length_cache, ray.ObjectID):
if isinstance(self._length_cache, ray.ObjectRef):
try:
self._length_cache = ray.get(self._length_cache)
except RayTaskError as e:
Expand All @@ -182,7 +182,7 @@ def width(self):
self._length_cache, self._width_cache = get_index_and_columns.remote(
self.oid
)
if isinstance(self._width_cache, ray.ObjectID):
if isinstance(self._width_cache, ray.ObjectRef):
try:
self._width_cache = ray.get(self._width_cache)
except RayTaskError as e:
Expand Down Expand Up @@ -210,7 +210,7 @@ def get_index_and_columns(df):
@ray.remote(num_returns=4)
def deploy_ray_func(call_queue, partition): # pragma: no cover
def deserialize(obj):
if isinstance(obj, ray.ObjectID):
if isinstance(obj, ray.ObjectRef):
return ray.get(obj)
return obj

Expand Down
8 changes: 4 additions & 4 deletions modin/engines/ray/pandas_on_ray/frame/partition_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
def func(df, apply_func, call_queue_df=None, call_queues_other=None, *others):
if call_queue_df is not None and len(call_queue_df) > 0:
for call, kwargs in call_queue_df:
if isinstance(call, ray.ObjectID):
if isinstance(call, ray.ObjectRef):
call = ray.get(call)
if isinstance(kwargs, ray.ObjectID):
if isinstance(kwargs, ray.ObjectRef):
kwargs = ray.get(kwargs)
df = call(df, **kwargs)
new_others = np.empty(shape=len(others), dtype=object)
for i, call_queue_other in enumerate(call_queues_other):
other = others[i]
if call_queue_other is not None and len(call_queue_other) > 0:
for call, kwargs in call_queue_other:
if isinstance(call, ray.ObjectID):
if isinstance(call, ray.ObjectRef):
call = ray.get(call)
if isinstance(kwargs, ray.ObjectID):
if isinstance(kwargs, ray.ObjectRef):
kwargs = ray.get(kwargs)
other = call(other, **kwargs)
new_others[i] = other
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, list_of_blocks):
self.list_of_blocks = [obj.oid for obj in list_of_blocks]

partition_type = OmnisciOnRayFramePartition
instance_type = ray.ObjectID
instance_type = ray.ObjectRef


class OmnisciOnRayFrameColumnPartition(OmnisciOnRayFrameAxisPartition):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class OmnisciOnRayFramePartition(BaseFramePartition):
def __init__(
self, object_id=None, frame_id=None, arrow_table=None, length=None, width=None
):
assert type(object_id) is ray.ObjectID
assert type(object_id) is ray.ObjectRef

self.oid = object_id
self.frame_id = frame_id
Expand Down
2 changes: 1 addition & 1 deletion modin/pandas/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
data: NumPy ndarray (structured or homogeneous) or dict:
Dict can contain Series, arrays, constants, or list-like
objects.
index: pandas.Index, list, ObjectID
index: pandas.Index, list
The row index for this DataFrame.
columns: pandas.Index
The column names for this DataFrame, in pandas Index object.
Expand Down