File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change
1
+ import os
2
+ from pathlib import Path
3
+ import urllib .request
4
+
1
5
from pyarrow import flight
2
6
3
- client = flight .connect ('grpc+tls://flight.spiceai.io' )
4
7
8
+ # Check for gRPC required Google certificate file
9
+ tls_root_certs = None
10
+ if not Path ('/usr' , 'share' , 'grpc' , 'roots.pem' ).exists ():
11
+ env_name = 'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH'
12
+ if env_name in os .environ and not Path (os .environ [env_name ]).exists ():
13
+ print ('Downloading gRPS root certificates' )
14
+ tls_root_certs = './roots.pem'
15
+ urllib .request .urlretrieve ('https://pki.google.com/roots.pem' , tls_root_certs )
16
+
17
+ client = flight .connect ('grpc+tls://flight.spiceai.io' , tls_root_certs = tls_root_certs )
5
18
headers = [client .authenticate_basic_token ('' , 'API_KEY' )]
6
19
options = flight .FlightCallOptions (headers = headers )
7
20
You can’t perform that action at this time.
0 commit comments