I have a dask expression as follows where I'm trying to run a sqlalchemy query in a distributed way. However, it references a .pem key file that's inputted in the connect_args
parameter. How do I upload this key file into the dask cluster/workers such that it will allow me to run this sqlalchemy query?
def execute_query(q):
conn = create_engine(f'presto://{user}:{password}@{host}:{port}/{catalog}/{schema}',
connect_args={'protocol': 'https',
'requests_kwargs': {'verify': key}})
return pd.read_sql(q, conn)
df = dd.from_delayed([
delayed(execute_query)(q) for q in queries])
I tried using client.upload_file
to send the local file to the cluster, but it complains that it's unable to find the path to the .pem key
OSError: Could not find a suitable TLS CA certificate bundle, invalid path: hdsj1ptc001.pem