-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
read_sql/to_sql should accept database URI as con parameter #10654
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
Comments
I think
|
Yes, I think this would be nice, and not too difficult. Do you want to give this a try? The suggestion you give seems good, only that the check is probably better done in |
Should I also change doc, create unit tests ? |
I possible yes, but whatever contribution would already be welcome. For the docs, just updating the docstring of the different functions would already be a start. And for the tests, a simple test that checks if the passing of a string uri works and the engine of the underlying SQLDatabase object is correctly created is OK. |
It may be a good idea to tell contributors how to run only ONE test in http://pandas.pydata.org/developers.html#running-the-test-suite
raises
|
I also wonder in which class should I put tests https://github.com/pydata/pandas/blob/master/pandas/io/tests/test_sql.py
run all tests of test_sql.py file but how to run one. |
Same comment here than in #10664 about table URI vs database URI Blaze uses table URI like |
@scls19fr To run a single class of tests or even a single test, the following works for me:
|
And I think putting it in |
My Mac doesn't like
|
According pandas-dev/pandas#10654 read from SQL database is now easier with Pandas than it was Instead of ``` import sqlalchemy as sa engine = sa.create_engine('sqlite://db.db') df = pd.read_sql('select * from t', con=engine) ``` we can do ``` df = pd.read_sql('select * from t', con='sqlite://db.db') ```
Hello,
it will be nice if
read_sql
(and soread_sql_query
andread_sql_table
could directly accept database URI ascon
parameterhttp://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_sql.html
So we could do
instead of :
Kind regards
PS: this kind of idea is also used by Blaze / odo
http://blaze.pydata.org/
http://odo.readthedocs.org/
PS2: A similar approach could maybe also apply to
to_sql(...)
The text was updated successfully, but these errors were encountered: