-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: Couldn't run sql: 'Connection' object has no attribute 'cursor' #59293
Comments
Thanks for the report. Can you include a full stack trace for the error being raised. Also, what is the output of |
this doesnt work:
This also doesn't work:
this works:
but gives warning:
Looks like |
@disarticulate your issue is unrelated. pandas 2.2+ requires sqlalchemy 2.0+ (see #57049). The OP shows that the version requirements are satisfied. |
I think I may be missing some info here, but for starters it may be better to restructure your code.
this will ensure your connection is opened and closed when you are requesting data. I wonder if it is an issue with the URI itself or the way you are passing the sql string as it works for me when I use it with my own database. |
Looks like some additional information is needed to help diagnose. Closing but feel free to open a new issue if you can provide that info |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Expected Behavior
Running SQL normally
Installed Versions
Replace this line with the output of pd.show_versions()
Name: pandas
Version: 2.2.2
Name: SQLAlchemy
Version: 2.0.31
The text was updated successfully, but these errors were encountered: