@@ -234,9 +234,7 @@ async def stream_data() -> AsyncGenerator[str, None]:
234234
235235
236236# A handler that reads OTel baggage from the ambient context and returns it.
237- async def baggage_echo_handler (
238- request : str , ctx : grpc .aio .ServicerContext
239- ) -> str :
237+ async def baggage_echo_handler (request : str , ctx : grpc .aio .ServicerContext ) -> str :
240238 all_baggage = baggage .get_all ()
241239 # Return baggage as a comma-separated "key=value" string
242240 return "," .join (f"{ k } ={ v } " for k , v in sorted (all_baggage .items ()))
@@ -245,7 +243,9 @@ async def baggage_echo_handler(
245243baggage_echo_handlers : HandlerMapping = {
246244 ("test_service" , "baggage_echo" ): (
247245 "rpc" ,
248- rpc_method_handler (baggage_echo_handler , deserialize_request , serialize_response ),
246+ rpc_method_handler (
247+ baggage_echo_handler , deserialize_request , serialize_response
248+ ),
249249 )
250250}
251251
@@ -258,10 +258,12 @@ def _enable_baggage_propagator():
258258 ``baggage`` HTTP header."""
259259 previous = propagate .get_global_textmap ()
260260 propagate .set_global_textmap (
261- CompositePropagator ([
262- TraceContextTextMapPropagator (),
263- W3CBaggagePropagator (),
264- ])
261+ CompositePropagator (
262+ [
263+ TraceContextTextMapPropagator (),
264+ W3CBaggagePropagator (),
265+ ]
266+ )
265267 )
266268 yield
267269 propagate .set_global_textmap (previous )
@@ -395,7 +397,7 @@ async def test_traceparent_propagated_via_ws_headers(
395397 the trace."""
396398 tracer = trace .get_tracer (__name__ )
397399
398- with tracer .start_as_current_span ("client-operation" ) as client_span :
400+ with tracer .start_as_current_span ("client-operation" ):
399401 # Also set some baggage
400402 ctx = baggage .set_baggage ("trace-test" , "yes" )
401403 token = context .attach (ctx )
0 commit comments