Skip to content

Commit 26d5c75

Browse files
author
Corentin
committed
Initial Commit
0 parents  commit 26d5c75

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

snippet.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import pyarrow as pa
2+
from pyarrow import flight
3+
4+
client = pa.flight.connect('grpc+tls://flight.spiceai.io')
5+
6+
headers = [client.authenticate_basic_token('', 'API_KEY')]
7+
options = flight.FlightCallOptions(headers=headers)
8+
9+
query = 'SELECT * FROM eth.blocks ORDER BY number DESC LIMIT 10;'
10+
flight_info = client.get_flight_info(flight.FlightDescriptor.for_command(query), options)
11+
reader = client.do_get(flight_info.endpoints[0].ticket, options)
12+
13+
print(reader.read_pandas())

0 commit comments

Comments
 (0)