-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: raise exception when sqlalchemy is required for database string URI #11920
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
ENH: raise exception when sqlalchemy is required for database string URI #11920
Conversation
this would need some tests |
@@ -617,9 +618,11 @@ def _engine_builder(con): | |||
|
|||
except ImportError: | |||
_SQLALCHEMY_INSTALLED = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also set this to True when it is imported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, no, sorry, this is good (the _is_sqlalchemy_connectable
does more than just setting the global value to True, so that should still be run)
@ksindi Thanks for the catch! For adding a test, you can put it in |
@jorisvandenbossche thanks. I'll change to ImportError and run tests. |
@jorisvandenbossche status of this? |
@jreback Haven't had a chance to work on it. |
pls rebase / update |
can you rebase/update |
can you rebase / update |
Get same error if mysql driver (e.g. mysqldb) is not installed. |
@ksindi Would you have some time to update this? |
@jorisvandenbossche I will get this done this week. Sorry for the delay. |
Current coverage is 85.29% (diff: 50.00%)@@ master #11920 diff @@
==========================================
Files 139 139
Lines 50138 50140 +2
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 42769 42769
- Misses 7369 7371 +2
Partials 0 0
|
@jorisvandenbossche added test |
@jreback not sure why getting build error. Let me know if there's anything else I need to do on my end. |
pls add a whatsnew note. |
you have linting errors: https://travis-ci.org/pydata/pandas/jobs/148568926 |
What's New
|
@jreback thanks will fix linting error tonight |
@jreback just an fyi I fixed linting errorr |
lgtm. @jorisvandenbossche |
@ksindi Thanks! |
AttributeError: 'str' object has no attribute 'cursor'
if sqlalchemy is not installed and I pass a database string URI topandas.read_sql
. I think the error should be made more explicit._SQLALCHEMY_INSTALLED
in_engine_builder
.