Skip to content

Commit 0883bb8

Browse files
committed
flake8
1 parent 58e89f0 commit 0883bb8

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

azure_functions_worker/dispatcher.py

+20-11
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ async def _handle__worker_init_request(self, request):
330330
self._function_metadata_exception = ex
331331

332332
if self._has_http_func:
333-
from azure.functions.extension.base import HttpV2FeatureChecker
333+
from azure.functions.extension.base \
334+
import HttpV2FeatureChecker
334335

335336
if HttpV2FeatureChecker.http_v2_enabled():
336337
capabilities[constants.HTTP_URI] = \
@@ -341,16 +342,18 @@ async def _handle__worker_init_request(self, request):
341342
worker_init_response=protos.WorkerInitResponse(
342343
capabilities=capabilities,
343344
worker_metadata=self.get_worker_metadata(),
344-
result=protos.StatusResult(status=protos.StatusResult.Success),
345+
result=protos.StatusResult(
346+
status=protos.StatusResult.Success),
345347
),
346348
)
347349
except Exception as e:
348350
logger.error("Error handling WorkerInitRequest: %s", str(e))
349351
return protos.StreamingMessage(
350352
request_id=self.request_id,
351353
worker_init_response=protos.WorkerInitResponse(
352-
result=protos.StatusResult(status=protos.StatusResult.Failure,
353-
exception=self._serialize_exception(e))
354+
result=protos.StatusResult(
355+
status=protos.StatusResult.Failure,
356+
exception=self._serialize_exception(e))
354357
),
355358
)
356359

@@ -594,16 +597,18 @@ async def _handle__invocation_request(self, request):
594597
call_error = None
595598
try:
596599
if fi.is_async:
597-
call_result = await self._run_async_func(fi_context, fi.func, args)
600+
call_result = \
601+
await self._run_async_func(fi_context, fi.func, args)
598602
else:
599603
call_result = await self._loop.run_in_executor(
600604
self._sync_call_tp,
601605
self._run_sync_func,
602606
invocation_id, fi_context, fi.func, args)
603607

604608
if call_result is not None and not fi.has_return:
605-
raise RuntimeError(f'function {fi.name!r} without a $return '
606-
'binding returned a non-None value')
609+
raise RuntimeError(
610+
f'function {fi.name!r} without a $return binding'
611+
'returned a non-None value')
607612
except Exception as e:
608613
call_error = e
609614
raise
@@ -717,7 +722,8 @@ async def _handle__function_environment_reload_request(self, request):
717722
self._function_metadata_exception = ex
718723

719724
if self._has_http_func:
720-
from azure.functions.extension.base import HttpV2FeatureChecker
725+
from azure.functions.extension.base \
726+
import HttpV2FeatureChecker
721727

722728
if HttpV2FeatureChecker.http_v2_enabled():
723729
capabilities[constants.HTTP_URI] = \
@@ -750,7 +756,8 @@ async def _handle__function_environment_reload_request(self, request):
750756
function_environment_reload_response=failure_response)
751757

752758
async def _initialize_http_server(self):
753-
from azure.functions.extension.base import ModuleTrackerMeta, RequestTrackerMeta
759+
from azure.functions.extension.base \
760+
import ModuleTrackerMeta, RequestTrackerMeta
754761

755762
web_extension_mod_name = ModuleTrackerMeta.get_module()
756763
extension_module = importlib.import_module(web_extension_mod_name)
@@ -769,7 +776,8 @@ async def catch_all(request: request_type): # type: ignore
769776
raise ValueError(f"Header {X_MS_INVOCATION_ID} not found")
770777
logger.info('Received HTTP request for invocation %s', invoc_id)
771778
http_coordinator.set_http_request(invoc_id, request)
772-
http_resp = await http_coordinator.await_http_response_async(invoc_id)
779+
http_resp = \
780+
await http_coordinator.await_http_response_async(invoc_id)
773781

774782
logger.info('Sending HTTP response for invocation %s', invoc_id)
775783
# if http_resp is an python exception, raise it
@@ -801,7 +809,8 @@ def index_functions(self, function_path: str):
801809

802810
indexed_function_logs: List[str] = []
803811
for func in indexed_functions:
804-
self._has_http_func = self._has_http_func or func.is_http_function()
812+
self._has_http_func = self._has_http_func or \
813+
func.is_http_function()
805814
function_log = "Function Name: {}, Function Binding: {}" \
806815
.format(func.get_function_name(),
807816
[(binding.type, binding.name) for binding in

0 commit comments

Comments
 (0)