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

Class ConvenienceServer

python/pyarrow/tests/test_flight.py:1331–1353  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1329
1330
1331class ConvenienceServer(FlightServerBase):
1332 """
1333 Server for testing various implementation conveniences (auto-boxing, etc.)
1334 """
1335
1336 @property
1337 def simple_action_results(self):
1338 return [b'foo', b'bar', b'baz']
1339
1340 def do_action(self, context, action):
1341 if action.type == 'simple-action':
1342 return self.simple_action_results
1343 elif action.type == 'echo':
1344 return [action.body]
1345 elif action.type == 'bad-action':
1346 return ['foo']
1347 elif action.type == 'arrow-exception':
1348 raise pa.ArrowMemoryError()
1349 elif action.type == 'forever':
1350 def gen():
1351 while not context.is_cancelled():
1352 yield b'foo'
1353 return gen()
1354
1355
1356def 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