Skip to content
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

AttributeError: 'Engine' object has no attribute 'cursor' in to_sql() -> _sql_item_exists(), newer versions of pandas (2.2.3) #213

Open
matthiasschuurmans opened this issue Nov 8, 2024 · 0 comments

Comments

@matthiasschuurmans
Copy link

When I run bcp.to_sql(), under the hood it runs _sql_item_exists(), which runs
res = pd.read_sql_query(sql=_qry, con=creds.engine)

This gives me an error with newer versions of pandas (I currently have 2.2.3) : AttributeError: 'Engine' object has no attribute 'cursor'.

I think it has to do with https://stackoverflow.com/a/77949093 , because if I change the code that produces the error to

with creds.engine.connect() as conn:
    res = pd.read_sql_query(sql=_qry, con=conn.connection)

It runs.

Thank you for your efforts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant