@@ -330,7 +330,8 @@ async def _handle__worker_init_request(self, request):
330
330
self ._function_metadata_exception = ex
331
331
332
332
if self ._has_http_func :
333
- from azure .functions .extension .base import HttpV2FeatureChecker
333
+ from azure .functions .extension .base \
334
+ import HttpV2FeatureChecker
334
335
335
336
if HttpV2FeatureChecker .http_v2_enabled ():
336
337
capabilities [constants .HTTP_URI ] = \
@@ -341,16 +342,18 @@ async def _handle__worker_init_request(self, request):
341
342
worker_init_response = protos .WorkerInitResponse (
342
343
capabilities = capabilities ,
343
344
worker_metadata = self .get_worker_metadata (),
344
- result = protos .StatusResult (status = protos .StatusResult .Success ),
345
+ result = protos .StatusResult (
346
+ status = protos .StatusResult .Success ),
345
347
),
346
348
)
347
349
except Exception as e :
348
350
logger .error ("Error handling WorkerInitRequest: %s" , str (e ))
349
351
return protos .StreamingMessage (
350
352
request_id = self .request_id ,
351
353
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 ))
354
357
),
355
358
)
356
359
@@ -594,16 +597,18 @@ async def _handle__invocation_request(self, request):
594
597
call_error = None
595
598
try :
596
599
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 )
598
602
else :
599
603
call_result = await self ._loop .run_in_executor (
600
604
self ._sync_call_tp ,
601
605
self ._run_sync_func ,
602
606
invocation_id , fi_context , fi .func , args )
603
607
604
608
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' )
607
612
except Exception as e :
608
613
call_error = e
609
614
raise
@@ -717,7 +722,8 @@ async def _handle__function_environment_reload_request(self, request):
717
722
self ._function_metadata_exception = ex
718
723
719
724
if self ._has_http_func :
720
- from azure .functions .extension .base import HttpV2FeatureChecker
725
+ from azure .functions .extension .base \
726
+ import HttpV2FeatureChecker
721
727
722
728
if HttpV2FeatureChecker .http_v2_enabled ():
723
729
capabilities [constants .HTTP_URI ] = \
@@ -750,7 +756,8 @@ async def _handle__function_environment_reload_request(self, request):
750
756
function_environment_reload_response = failure_response )
751
757
752
758
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
754
761
755
762
web_extension_mod_name = ModuleTrackerMeta .get_module ()
756
763
extension_module = importlib .import_module (web_extension_mod_name )
@@ -769,7 +776,8 @@ async def catch_all(request: request_type): # type: ignore
769
776
raise ValueError (f"Header { X_MS_INVOCATION_ID } not found" )
770
777
logger .info ('Received HTTP request for invocation %s' , invoc_id )
771
778
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 )
773
781
774
782
logger .info ('Sending HTTP response for invocation %s' , invoc_id )
775
783
# if http_resp is an python exception, raise it
@@ -801,7 +809,8 @@ def index_functions(self, function_path: str):
801
809
802
810
indexed_function_logs : List [str ] = []
803
811
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 ()
805
814
function_log = "Function Name: {}, Function Binding: {}" \
806
815
.format (func .get_function_name (),
807
816
[(binding .type , binding .name ) for binding in
0 commit comments