Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ray client] lint: do not use comprehension #46465

Merged
merged 1 commit into from
Jul 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/ray/util/client/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _use_response_cache(func):

@functools.wraps(func)
def wrapper(self, request, context):
metadata = {k: v for k, v in context.invocation_metadata()}
metadata = dict(context.invocation_metadata())
expected_ids = ("client_id", "thread_id", "req_id")
if any(i not in metadata for i in expected_ids):
# Missing IDs, skip caching and call underlying stub directly
Expand Down Expand Up @@ -455,7 +455,7 @@ def send_get_response(result: Any) -> None:
return ray_client_pb2.GetResponse(valid=False, error=cloudpickle.dumps(e))

def GetObject(self, request: ray_client_pb2.GetRequest, context):
metadata = {k: v for k, v in context.invocation_metadata()}
metadata = dict(context.invocation_metadata())
client_id = metadata.get("client_id")
if client_id is None:
yield ray_client_pb2.GetResponse(
Expand Down