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

Class ConvenienceServer

python/pyarrow/tests/test_flight.py:1293–1315  ·  view source on GitHub ↗

Server for testing various implementation conveniences (auto-boxing, etc.)

Source from the content-addressed store, hash-verified

1291
1292
1293class ConvenienceServer(FlightServerBase):
1294 """
1295 Server for testing various implementation conveniences (auto-boxing, etc.)
1296 """
1297
1298 @property
1299 def simple_action_results(self):
1300 return [b'foo', b'bar', b'baz']
1301
1302 def do_action(self, context, action):
1303 if action.type == 'simple-action':
1304 return self.simple_action_results
1305 elif action.type == 'echo':
1306 return [action.body]
1307 elif action.type == 'bad-action':
1308 return ['foo']
1309 elif action.type == 'arrow-exception':
1310 raise pa.ArrowMemoryError()
1311 elif action.type == 'forever':
1312 def gen():
1313 while not context.is_cancelled():
1314 yield b'foo'
1315 return gen()
1316
1317
1318def test_do_action_result_convenience():

Callers 3

test_streaming_do_actionFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_streaming_do_actionFunction · 0.68