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

error when detecting is connection is custom #433

Closed
edublancas opened this issue Apr 22, 2023 · 2 comments · Fixed by #517
Closed

error when detecting is connection is custom #433

edublancas opened this issue Apr 22, 2023 · 2 comments · Fixed by #517
Assignees

Comments

@edublancas
Copy link

edublancas commented Apr 22, 2023

(Note that this error can only be reproduced with #431, which hasn't been merged yet)

while improving some error messages, I encountered this:

image

Note that the error message doesn't accurately display the error in the df variable. Instead, if shows ''

I tracked down the error to this method:

def is_custom_connection(conn=None) -> bool:

Since int is not part of the list of checks:

conn, (sqlalchemy.engine.base.Connection, Connection, str, bool)

It fails. Which breaks the SQLCommand logic (the is_custom_connection is called there).

We need a more robust way to check whether a connection is custom or not. A better approach is to check if the connection object has all the attributes expected from the DB API: close, commit, rollback and cursor (https://peps.python.org/pep-0249/)

@tonykploomber
Copy link

I am trying to reproduce the error.
Do you mind to share how you make duckdb:// connection as custom?

Screenshot 2023-04-24 at 4 18 08 PM

@edublancas
Copy link
Author

@tonykploomber: I just realized this could not be reproduced with the code in master. Let's wait until #431 is merged - I reproduced it while working on that PR

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

Successfully merging a pull request may close this issue.

3 participants