We have error on xxxx SELECT query: 'str' object has no attribute 'limit'

Usage question here.

            query = """
            SELECT ROW_NUMBER () OVER (ORDER BY ID) AS row_id, ID, user_ID, retweet_count, tweet, prediction
            FROM tweet
            WHERE created_at BETWEEN '2021-03-01' AND '2021-04-01'
            """

            print("Getting tweets...")
            df_tweet = dd.read_sql_query(query, URI, index_col = "row_id", columns = ['row_id', 'ID', 'user_ID', 'retweet_count', 'tweet', 'prediction'])

What I’m running into is We have error on xxxx SELECT query: 'str' object has no attribute 'limit'. I figured this had to do with my index but it’s definitely numeric. What is the proper way to use read_sql_query?

Also, if it matters, this is a Postgres database and I’m using an SQLAlchemy style URI for the connection parameter. I noticed that when I purposely create a parse error in the query, I get the same error as well. I assume I haven’t defined something properly.

Thanks in advance!

@dyerrington Welcome to Discourse, and thanks for your patience! Have you resolved this already?

If not, I’m guessing the error is because the dates ('2021-03-01' , '2021-04-01') are being inferred as str instead of dates (or similar type to the created_at column) that can be compared. Would you be able to share a minimal example using some toy data along with the complete error traceback? I’m also curious if this works in pandas?