j riot j riot - 5 months ago 73
SQL Question

read_sql chunksize error

I have a data-set (14gb) and I am trying to pull the data in from MySQL using

chunksize
. However, I continue to get the following error:

TypeError: read_sql_query() got an unexpected keyword argument 'chunksize'


Here is my code:

for chunk in pandas.read_sql_query(sql = SQL_QUERY, con = MYSQL_PHOENIX, chunksize = 10000):
DO STUFF TO chunk


I cannot for the life of me figure out why it is producing this error.

Thank you!

Answer

The chunksize parameter for pandas.read_sql_query was introduced between pandas versions 0.14 and 0.15, so you likely have an older version. Update if you can.