MCPcopy Create free account
hub / github.com/apache/arrow / do_action

Method do_action

python/examples/flight/middleware.py:102–116  ·  view source on GitHub ↗
(self, context, action)

Source from the content-addressed store, hash-verified

100 ]
101
102 def do_action(self, context, action):
103 trace_middleware = context.get_middleware("trace")
104 if trace_middleware:
105 TraceContext.set_trace_id(trace_middleware.trace_id)
106 if action.type == "get-trace-id":
107 if self.delegate:
108 for result in self.delegate.do_action(action):
109 yield result
110 else:
111 trace_id = TraceContext.current_trace_id().encode("utf-8")
112 print("Returning trace ID:", trace_id)
113 buf = pa.py_buffer(trace_id)
114 yield pa.flight.Result(buf)
115 else:
116 raise KeyError(f"Unknown action {action.type!r}")
117
118
119def main():

Callers 1

mainFunction · 0.45

Calls 5

KeyErrorFunction · 0.85
set_trace_idMethod · 0.80
current_trace_idMethod · 0.80
ResultMethod · 0.80
encodeMethod · 0.45

Tested by

no test coverage detected