-
Notifications
You must be signed in to change notification settings - Fork 4
/
test_e2e.py
36 lines (27 loc) · 1.09 KB
/
test_e2e.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# (C) 2024 GoodData Corporation
import orjson
import pyarrow.flight
#
# Few sample end-to-end tests which exercise the sample function by making
# Flight RPC calls.
#
def test_list_flexconnect_funs(testing_flexconnect_server):
c = pyarrow.flight.FlightClient(testing_flexconnect_server.location)
for flight_info in c.list_flights():
function_descriptor = orjson.loads(flight_info.descriptor.command)
assert function_descriptor["functionName"] == "SampleFlexConnectFunction"
def test_function_call(testing_flexconnect_server, flexconnect_call_parameters):
c = pyarrow.flight.FlightClient(testing_flexconnect_server.location)
flight_info = c.get_flight_info(
pyarrow.flight.FlightDescriptor.for_command(
orjson.dumps(
{
"functionName": "SampleFlexConnectFunction",
"parameters": flexconnect_call_parameters,
}
)
)
)
data: pyarrow.Table = c.do_get(flight_info.endpoints[0].ticket).read_all()
assert data.num_rows == 6
assert data.num_columns == 6