Skip to content

Commit

Permalink
chore: update black dependency (#6162)
Browse files Browse the repository at this point in the history
Co-authored-by: Jina Dev Bot <[email protected]>
  • Loading branch information
JoanFM and jina-bot authored Apr 3, 2024
1 parent 95906b0 commit f091fd6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion extra-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ flaky: test
mock: test
requests-mock: test
pytest-custom_exit_code: test
black==22.3.0: test
black==24.3.0: test
kubernetes>=18.20.0: test
pytest-kind==22.11.1: test
pytest-lazy-fixture: test
Expand Down
4 changes: 1 addition & 3 deletions jina/clients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ def Client(
# overload_inject_end_client


def Client(
args: Optional['argparse.Namespace'] = None, **kwargs
) -> Union[
def Client(args: Optional['argparse.Namespace'] = None, **kwargs) -> Union[
'AsyncWebSocketClient',
'WebSocketClient',
'AsyncGRPCClient',
Expand Down
6 changes: 2 additions & 4 deletions jina/orchestrate/flow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1778,10 +1778,8 @@ def build(self, copy_flow: bool = False, **kwargs) -> 'Flow':
op_flow._deployment_nodes[GATEWAY_NAME].args.graph_description = json.dumps(
op_flow._get_graph_representation()
)
op_flow._deployment_nodes[
GATEWAY_NAME
].args.deployments_addresses = json.dumps(
op_flow._get_deployments_addresses()
op_flow._deployment_nodes[GATEWAY_NAME].args.deployments_addresses = (
json.dumps(op_flow._get_deployments_addresses())
)

op_flow._deployment_nodes[GATEWAY_NAME].update_pod_args()
Expand Down
28 changes: 14 additions & 14 deletions jina/serve/executors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,21 +401,21 @@ def __init__(
self._init_monitoring()
self._init_workspace = workspace
if __dry_run_endpoint__ not in self.requests:
self.requests[
__dry_run_endpoint__
] = _FunctionWithSchema.get_function_with_schema(
self.__class__._dry_run_func
self.requests[__dry_run_endpoint__] = (
_FunctionWithSchema.get_function_with_schema(
self.__class__._dry_run_func
)
)
else:
self.logger.warning(
f' Endpoint {__dry_run_endpoint__} is defined by the Executor. Be aware that this endpoint is usually reserved to enable health checks from the Client through the gateway.'
f' So it is recommended not to expose this endpoint. '
)
if type(self) == BaseExecutor:
self.requests[
__default_endpoint__
] = _FunctionWithSchema.get_function_with_schema(
self.__class__._dry_run_func
self.requests[__default_endpoint__] = (
_FunctionWithSchema.get_function_with_schema(
self.__class__._dry_run_func
)
)

self._lock = contextlib.AsyncExitStack()
Expand Down Expand Up @@ -595,14 +595,14 @@ def _add_requests(self, _requests: Optional[Dict]):
_func = getattr(self.__class__, func)
if callable(_func):
# the target function is not decorated with `@requests` yet
self.requests[
endpoint
] = _FunctionWithSchema.get_function_with_schema(_func)
self.requests[endpoint] = (
_FunctionWithSchema.get_function_with_schema(_func)
)
elif typename(_func) == 'jina.executors.decorators.FunctionMapper':
# the target function is already decorated with `@requests`, need unwrap with `.fn`
self.requests[
endpoint
] = _FunctionWithSchema.get_function_with_schema(_func.fn)
self.requests[endpoint] = (
_FunctionWithSchema.get_function_with_schema(_func.fn)
)
else:
raise TypeError(
f'expect {typename(self)}.{func} to be a function, but receiving {typename(_func)}'
Expand Down

0 comments on commit f091fd6

Please sign in to comment.