Note: I posted the question at https://github.com/catherinedevlin/ipython-sql/issues/149
I can connect hive/presto using create_engine
like this
from sqlalchemy.engine import create_engine
conn = create_engine(
'presto://user@host:port',
connect_args={'protocol': 'https',
'requests_kwargs': {
'auth': HTTPBasicAuth('user', 'pw'),
'verify': '/cert.pem',
}}
)
df = pd.read_sql("SELECT * FROM dw.my_table", conn)
However, if I use ipython-sql
, how should I connect?
From the doc, it seems only support string passed to create_engine
, something like this
%%sql postgresql://will:longliveliz@localhost/shakes
select * from character
where abbrev = 'ALICE
How can I specify additional configs in connect_args
?