mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 08:46:01 +08:00
Lint Python files with Yapf (#1872)
This commit is contained in:
committed by
Robert Nishihara
parent
a3ddde398c
commit
74162d1492
+11
-8
@@ -46,7 +46,10 @@ def format_error_message(exception_message, task_exception=False):
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def push_error_to_driver(redis_client, error_type, message, driver_id=None,
|
||||
def push_error_to_driver(redis_client,
|
||||
error_type,
|
||||
message,
|
||||
driver_id=None,
|
||||
data=None):
|
||||
"""Push an error message to the driver to be printed in the background.
|
||||
|
||||
@@ -64,9 +67,11 @@ def push_error_to_driver(redis_client, error_type, message, driver_id=None,
|
||||
driver_id = DRIVER_ID_LENGTH * b"\x00"
|
||||
error_key = ERROR_KEY_PREFIX + driver_id + b":" + _random_string()
|
||||
data = {} if data is None else data
|
||||
redis_client.hmset(error_key, {"type": error_type,
|
||||
"message": message,
|
||||
"data": data})
|
||||
redis_client.hmset(error_key, {
|
||||
"type": error_type,
|
||||
"message": message,
|
||||
"data": data
|
||||
})
|
||||
redis_client.rpush("ErrorKeys", error_key)
|
||||
|
||||
|
||||
@@ -134,10 +139,8 @@ def hex_to_binary(hex_identifier):
|
||||
return binascii.unhexlify(hex_identifier)
|
||||
|
||||
|
||||
FunctionProperties = collections.namedtuple("FunctionProperties",
|
||||
["num_return_vals",
|
||||
"resources",
|
||||
"max_calls"])
|
||||
FunctionProperties = collections.namedtuple(
|
||||
"FunctionProperties", ["num_return_vals", "resources", "max_calls"])
|
||||
"""FunctionProperties: A named tuple storing remote functions information."""
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user