mirror of
https://github.com/wassname/ray.git
synced 2026-07-05 04:13:12 +08:00
Fix UI issue for non-json-serializable task arguments. (#1892)
* Fix UI issue for non-json-serializable task arguments. * Simplify approach.
This commit is contained in:
committed by
Philipp Moritz
parent
3383553dc0
commit
7792032ee3
@@ -594,6 +594,10 @@ class GlobalState(object):
|
||||
# TODO (hme): do something to correct slider here,
|
||||
# slider should be correct to begin with, though.
|
||||
task_table[task_id] = self.task_table(task_id)
|
||||
task_table[task_id]["TaskSpec"]["Args"] = [
|
||||
repr(arg)
|
||||
for arg in task_table[task_id]["TaskSpec"]["Args"]
|
||||
]
|
||||
except Exception as e:
|
||||
print("Could not find task {}".format(task_id))
|
||||
|
||||
|
||||
+11
-2
@@ -2057,7 +2057,7 @@ class GlobalStateAPI(unittest.TestCase):
|
||||
ray.init(redirect_output=True)
|
||||
|
||||
@ray.remote
|
||||
def f():
|
||||
def f(*xs):
|
||||
return 1
|
||||
|
||||
@ray.remote
|
||||
@@ -2068,7 +2068,16 @@ class GlobalStateAPI(unittest.TestCase):
|
||||
def method(self):
|
||||
pass
|
||||
|
||||
ray.get([f.remote() for _ in range(10)])
|
||||
# We use a number of test objects because objects that are not JSON
|
||||
# serializable caused problems in the past.
|
||||
test_objects = [
|
||||
0, 0.5, "hi", b"hi",
|
||||
ray.put(0),
|
||||
np.zeros(3), [0], (0, ), {
|
||||
0: 0
|
||||
}, True, False, None
|
||||
]
|
||||
ray.get([f.remote(obj) for obj in test_objects])
|
||||
actors = [Foo.remote() for _ in range(5)]
|
||||
ray.get([actor.method.remote() for actor in actors])
|
||||
ray.get([actor.method.remote() for actor in actors])
|
||||
|
||||
Reference in New Issue
Block a user