Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
read_sql: TypeError: Argument 'rows' has incorrect type #11522
Comments
|
@PetitLepton Thanks for the report. Can you show the output of?
|
jorisvandenbossche
added the
IO SQL
label
Nov 5, 2015
PetitLepton
commented
Nov 6, 2015
|
@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
added this to the
0.17.1
milestone
Nov 6, 2015
|
@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 |
jorisvandenbossche
added Difficulty Novice Effort Low
labels
Nov 10, 2015
jreback
modified the milestone: Next Major Release, 0.17.1
Nov 15, 2015
grahamjeffries
referenced
this issue
Dec 17, 2015
Merged
BUG: force list type for tuples from chunked sql table reads #11522 #11861
jorisvandenbossche
closed this
in #11861
Dec 19, 2015
jorisvandenbossche
added a commit
that referenced
this issue
Dec 19, 2015
|
|
jorisvandenbossche |
1357321
|
PetitLepton commentedNov 5, 2015
Hi,
I encountered a problem when using read_sql with a remote mySQL database.
After loading the modules,
I create both a
pymysqlconnector and asqlalchemyengine withpymysqlfor the same database.Everything is fine with the engine
but fails with the connector
Here are the versions of the modules
Best regards,
Flavien.