Commit e860fadc authored by mouadh's avatar mouadh

optimization 2 (use iter instead fetchall())

parent 732b4d9d
......@@ -28,9 +28,10 @@ def _load_tables_db(executer_instance):
.execution_options(stream_results=True)
.execute('SELECT * FROM "{0}"'.format(table_name)))
# Fetch all the results of the query
fetchall = results.fetchall()
# fetchall = results.fetchone()
value = pd.DataFrame(fetchall,columns=results.keys())
# fetchall = results.fetchall()
# # fetchall = results.fetchone()
# value = pd.DataFrame(fetchall,columns=results.keys())
value = pd.DataFrame(iter(results),columns=results.keys()) # Pass results as an iterator
tables[table_name] = value[[
col for col in value.columns if col.lower()[-3:] != '_id'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment