forked from catherinedevlin/ipython-sql
-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
What happens?
Description of the problem
What i'm trying to do:
Use a connection using trino python through a connection string
%sql trino://https://trino-coordinator:8443/mycatalog/myschema?verify=false
o in equivalent way using toml connection configuration
[myConnection]
drivername = trino
host = https://trino-coordinator
port = 8443
database = mycatalog/myschema
query = { "verify": "false" }
But i'm getting the following error:
UsageError: An error happened while creating the connection: invalid literal for int() with base 10: 'trino-coordinator:8443'.
To fix it:
Pass a valid connection string:
Example: %sql postgresql://username:password@hostname/dbname
For more details, see: https://jupysql.ploomber.io/en/latest/connecting.html
Cause of the issue
I think the issue is caused by the use of the schema used in the host
component parsed by JupySQL
The following connection configuration works
%sql trino://trino-coordinator:8080/mycatalog/myschema
or
[myConnection]
drivername = trino
host = trino-coordinator
port = 8443
database = mycatalog/myschema
query = { "verify": "false" }
(i'm omitting credentials)
Connection is created but trino dbapi implementation instance it based on the the schema of host component by default using urllib.parse.urlparse or using http
if not provided.
In my use case i need to use https
since i pass also access_token and other query parameters to trino.
To Reproduce
%sql trino://https://trino-coordinator:8443/mycatalog/myschema?verify=false
o in equivalent way using toml connection configuration
[myConnection]
drivername = trino
host = https://trino-coordinator
port = 8443
database = mycatalog/myschema
query = { "verify": "false" }
OS:
Linux
JupySQL Version:
0.11.1
Full Name:
Jacopo Rimediotti
Affiliation:
Iconsulting
Metadata
Metadata
Assignees
Labels
No labels