From 9ded69fdaa09aa471a500a4a350b3aa751c531c8 Mon Sep 17 00:00:00 2001 From: fangfengbin <869218239a@zju.edu.cn> Date: Sat, 12 Dec 2020 02:15:53 +0800 Subject: [PATCH] [Hotfix] Fix python client lint error (#12783) --- python/ray/experimental/client/api.py | 8 ++++---- python/ray/experimental/client/server/server.py | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/python/ray/experimental/client/api.py b/python/ray/experimental/client/api.py index 13443149c..304cc4467 100644 --- a/python/ray/experimental/client/api.py +++ b/python/ray/experimental/client/api.py @@ -133,8 +133,8 @@ class APIImpl(ABC): that should be canceled. force (boolean): Whether to force-kill a running task by killing the worker that is running the task. - recursive (boolean): Whether to try to cancel tasks submitted by the - task specified. + recursive (boolean): Whether to try to cancel tasks submitted by + the task specified. """ pass @@ -207,8 +207,8 @@ class ClientAPI(APIImpl): def available_resources(self): """Get the current available cluster resources. - This is different from `cluster_resources` in that this will return idle - (available) resources rather than total resources. + This is different from `cluster_resources` in that this will return + idle (available) resources rather than total resources. Note that this information can grow stale as tasks start and finish. diff --git a/python/ray/experimental/client/server/server.py b/python/ray/experimental/client/server/server.py index 4db4cd22a..616e6e60d 100644 --- a/python/ray/experimental/client/server/server.py +++ b/python/ray/experimental/client/server/server.py @@ -38,7 +38,8 @@ class RayletServicer(ray_client_pb2_grpc.RayletDriverServicer): resp.resource_table.CopyFrom( ray_client_pb2.ClusterInfoResponse.ResourceTable( table=float_resources)) - elif request.type == ray_client_pb2.ClusterInfoType.AVAILABLE_RESOURCES: + elif request.type == \ + ray_client_pb2.ClusterInfoType.AVAILABLE_RESOURCES: resources = ray.available_resources() # Normalize resources into floats # (the function may return values that are ints) @@ -78,8 +79,8 @@ class RayletServicer(ray_client_pb2_grpc.RayletDriverServicer): return_exception_in_context(e, context) else: raise RuntimeError( - "Client requested termination without providing a valid terminate_type" - ) + "Client requested termination without providing a valid " + "terminate_type") return ray_client_pb2.TerminateResponse(ok=True) def GetObject(self, request, context=None):