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

Class InvalidStreamFlightServer

python/pyarrow/tests/test_flight.py:354–367  ·  view source on GitHub ↗

A Flight server that tries to return messages with differing schemas.

Source from the content-addressed store, hash-verified

352
353
354class InvalidStreamFlightServer(FlightServerBase):
355 """A Flight server that tries to return messages with differing schemas."""
356
357 schema = pa.schema([('a', pa.int32())])
358
359 def do_get(self, context, ticket):
360 data1 = [pa.array([-10, -5, 0, 5, 10], type=pa.int32())]
361 data2 = [pa.array([-10.0, -5.0, 0.0, 5.0, 10.0], type=pa.float64())]
362 assert data1.type != data2.type
363 table1 = pa.Table.from_arrays(data1, names=['a'])
364 table2 = pa.Table.from_arrays(data2, names=['a'])
365 assert table1.schema == self.schema
366
367 return flight.GeneratorStream(self.schema, [table1, table2])
368
369
370class NeverSendsDataFlightServer(FlightServerBase):

Callers 1

Calls 1

schemaMethod · 0.45

Tested by 1