-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Closed
Copy link
Labels
needs infoNeeds further information from the userNeeds further information from the user
Description
import dask.dataframe as dd
uri = f"trino://{user}:{quote(password)}@{host}:{port}/{catalog}"
query = "SELECT * FROM my_table"
ddf = dd.read_sql_query(sql=query, con=uri, index_col="index_col")AttributeError Traceback (most recent call last)
Cell In[36], line 5
1 import dask.dataframe as dd
3 uri = f"trino://{user}:{quote(password)}@{host}:{port}/{catalog}"
----> 5 ddf = dd.read_sql_query(sql=query, con=uri, index_col="idx")
File /opt/conda/lib/python3.12/site-packages/dask/dataframe/io/sql.py:122, in read_sql_query(sql, con, index_col, divisions, npartitions, limits, bytes_per_chunk, head_rows, meta, engine_kwargs, **kwargs)
118 kwargs["index_col"] = index.name
120 if head_rows > 0:
121 # derive metadata from first few rows
--> 122 q = sql.limit(head_rows)
123 head = pd.read_sql(q, engine, **kwargs)
125 if len(head) == 0:
126 # no results at all
AttributeError: 'str' object has no attribute 'limit'
Describe the issue:
AttributeError: 'str' object has no attribute 'limit' when using dask.dataframe.read_sql_query
Minimal Complete Verifiable Example:
import dask.dataframe as dd
uri = f"trino://{user}:{quote(password)}@{host}:{port}/{catalog}"
query = "SELECT * FROM my_table"
ddf = dd.read_sql_query(sql=query, con=uri, index_col="index_col")Anything else we need to know?:
Reading from Trino database.
Environment:
- Dask version: 2025.5.1
- Python version: 3.12.9
- Operating System: Linux Ubuntu 22.04.5 LTS
- Install method (conda, pip, source):
pip install dask
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs infoNeeds further information from the userNeeds further information from the user