Remove unused _post_get_hooks (#12270)

This commit is contained in:
Edward Oakes
2020-11-23 20:30:30 -06:00
committed by GitHub
parent a93ed4583d
commit 1b3c48b922
2 changed files with 1 additions and 19 deletions
-10
View File
@@ -476,16 +476,6 @@ def test_decorated_function(ray_start_regular):
assert ray.get(result_id) == (3, 2, 1, 5)
def test_get_postprocess(ray_start_regular):
def get_postprocessor(object_refs, values):
return [value for value in values if value > 0]
ray.worker.global_worker._post_get_hooks.append(get_postprocessor)
assert ray.get(
[ray.put(i) for i in [0, 1, 3, 5, -1, -3, 4]]) == [1, 3, 5, 4]
def test_export_after_shutdown(ray_start_regular):
# This test checks that we can use actor and remote function definitions
# across multiple Ray sessions.
+1 -9
View File
@@ -122,9 +122,6 @@ class Worker:
# Index of the current session. This number will
# increment every time when `ray.shutdown` is called.
self._session_index = 0
# Functions to run to process the values returned by ray.get. Each
# postprocessor must take two arguments ("object_refs", and "values").
self._post_get_hooks = []
@property
def connected(self):
@@ -827,7 +824,6 @@ def shutdown(_exiting_interpreter=False):
# TODO(rkn): Instead of manually resetting some of the worker fields, we
# should simply set "global_worker" to equal "None" or something like that.
global_worker.set_mode(None)
global_worker._post_get_hooks = []
atexit.register(shutdown, True)
@@ -1312,7 +1308,7 @@ def show_in_dashboard(message, key="", dtype="text"):
worker.core_worker.set_webui_display(key.encode(), message_encoded)
# Global varaible to make sure we only send out the warning once
# Global variable to make sure we only send out the warning once.
blocking_get_inside_async_warned = False
@@ -1380,10 +1376,6 @@ def get(object_refs, *, timeout=None):
else:
raise value
# Run post processors.
for post_processor in worker._post_get_hooks:
values = post_processor(object_refs, values)
if is_individual_id:
values = values[0]
return values