Workaround for passing empty list to ray.wait. (#1043)

* Workaround for passing empty list to ray.wait.

* Add test for passing empty list to wait.
This commit is contained in:
Robert Nishihara
2017-10-01 11:45:02 -07:00
committed by Philipp Moritz
parent 79e013e876
commit ad61af7333
2 changed files with 11 additions and 0 deletions
+6
View File
@@ -2114,6 +2114,12 @@ def wait(object_ids, num_returns=1, timeout=None, worker=global_worker):
if worker.mode == PYTHON_MODE:
return object_ids[:num_returns], object_ids[num_returns:]
# TODO(rkn): This is a temporary workaround for
# https://github.com/ray-project/ray/issues/997. However, it should be
# fixed in Arrow instead of here.
if len(object_ids) == 0:
return [], []
object_id_strs = [plasma.ObjectID(object_id.id())
for object_id in object_ids]
timeout = timeout if timeout is not None else 2 ** 30