This is an automated email from the ASF dual-hosted git repository.
kszucs pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new af86869 ARROW-4954: [Python] Fix test failure with Flight enabled
af86869 is described below
commit af86869ceb1d8dd352d39d81c19ee5ac05d251cd
Author: Antoine Pitrou <[email protected]>
AuthorDate: Tue Mar 19 08:53:38 2019 +0100
ARROW-4954: [Python] Fix test failure with Flight enabled
Avoid allocating static test data.
Author: Antoine Pitrou <[email protected]>
Closes #3968 from pitrou/ARROW-4954-flight-python-test-failure and squashes
the following commits:
e44b26e2 <Antoine Pitrou> ARROW-4954: Fix test failure with Flight enabled
---
python/pyarrow/tests/test_flight.py | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/python/pyarrow/tests/test_flight.py
b/python/pyarrow/tests/test_flight.py
index 73dd018..93c6a87 100644
--- a/python/pyarrow/tests/test_flight.py
+++ b/python/pyarrow/tests/test_flight.py
@@ -68,15 +68,18 @@ class EchoStreamFlightServer(EchoFlightServer):
class InvalidStreamFlightServer(flight.FlightServerBase):
"""A Flight server that tries to return messages with differing schemas."""
- data1 = [pa.array([-10, -5, 0, 5, 10])]
- data2 = [pa.array([-10.0, -5.0, 0.0, 5.0, 10.0])]
- table1 = pa.Table.from_arrays(data1, names=['a'])
- table2 = pa.Table.from_arrays(data2, names=['a'])
- schema = table1.schema
+ schema = pa.schema([('a', pa.int32())])
def do_get(self, ticket):
- return flight.GeneratorStream(self.schema, [self.table1, self.table2])
+ data1 = [pa.array([-10, -5, 0, 5, 10], type=pa.int32())]
+ data2 = [pa.array([-10.0, -5.0, 0.0, 5.0, 10.0], type=pa.float64())]
+ assert data1.type != data2.type
+ table1 = pa.Table.from_arrays(data1, names=['a'])
+ table2 = pa.Table.from_arrays(data2, names=['a'])
+ assert table1.schema == self.schema
+
+ return flight.GeneratorStream(self.schema, [table1, table2])
@contextlib.contextmanager