-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
read_sql: TypeError: Argument 'rows' has incorrect type #11522
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
@PetitLepton Thanks for the report. Can you show the output of?
|
@jorisvandenbossche Hi, this one works fine, I was using it so far cur = connector.cursor()
cur.execute("SELECT id, created_at FROM themes")
cur.fetchall()
((1, datetime.datetime(2012, 12, 2, 4, 6, 17)),
(2, datetime.datetime(2012, 12, 2, 4, 20, 56)),
(4, datetime.datetime(2012, 12, 2, 4, 57, 39)),
(5, datetime.datetime(2012, 12, 2, 4, 59, 31)),
(6, datetime.datetime(2012, 12, 2, 5, 3, 7)),
... |
Thanks! As I suspected, the problem is that it returns a tuple of tuples instead of a list of tuples, and
This has always been the case in pandas, so I am wondering if this is a change in @jreback This is easily solved in the sql code by ensuring it is a list before passing to |
@jorisvandenbossche no, list-of-tuples is the specified type, tuple-of-tuple is not allowed as I think it can signify nested types that would require more parsing (its not allowed in the I suppose these might be able to be relaxed but would be a separate issue
|
OK, no problem. It is easy to ensure in the SQL code that it is a list of tuples and not a tuple of tuples |
BUG: force list type for tuples from chunked sql table reads #11522
Hi,
I encountered a problem when using read_sql with a remote mySQL database.
After loading the modules,
I create both a
pymysql
connector and asqlalchemy
engine withpymysql
for the same database.Everything is fine with the engine
but fails with the connector
Here are the versions of the modules
Best regards,
Flavien.
The text was updated successfully, but these errors were encountered: