From ec4f8d531132fa4d38b8a68f6b3e0f19c37c281b Mon Sep 17 00:00:00 2001 From: Ujval Misra Date: Tue, 17 Dec 2019 23:59:43 -0800 Subject: [PATCH] [hotfix][tune] fix get_sync_client. (#6525) --- python/ray/tune/sync_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/ray/tune/sync_client.py b/python/ray/tune/sync_client.py index 3f6d5dba6..9579af836 100644 --- a/python/ray/tune/sync_client.py +++ b/python/ray/tune/sync_client.py @@ -32,11 +32,13 @@ def get_sync_client(sync_function): """Returns a sync client. Args: - sync_function (str|function): Sync function. + sync_function (Optional[str|function]): Sync function. Raises: ValueError if sync_function is malformed. """ + if sync_function is None: + return None if isinstance(sync_function, types.FunctionType): client_cls = FunctionBasedClient elif isinstance(sync_function, str):