Skip to content

Instantly share code, notes, and snippets.

@samredai
Created July 9, 2024 15:13
Show Gist options
  • Save samredai/61c05779b64c5ddd64bfed641d35c102 to your computer and use it in GitHub Desktop.
Save samredai/61c05779b64c5ddd64bfed641d35c102 to your computer and use it in GitHub Desktop.
Python: An example of querying trino using sqlalchemy
# pip install trino
from sqlalchemy.engine import create_engine
import pandas as pd
uri = "trino://localhost:8080/tpch/sf1"
engine = create_engine(uri, connect_args={'http_scheme': 'http', 'user': 'admin'})
connection = engine.connect()
df = pd.read_sql("select * from customer", connection)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment