Commit 06e3e07b authored by mouadh's avatar mouadh

note to test

parent 40f1ab97
...@@ -62,6 +62,8 @@ def string_folding_wrapper(results): ...@@ -62,6 +62,8 @@ def string_folding_wrapper(results):
for key in keys for key in keys
) )
# TODO try pandas.read_sql_table and pandas.read_sql
def _load_tables_db(executer_instance): def _load_tables_db(executer_instance):
""" """
Load tables from database. Load tables from database.
...@@ -82,6 +84,7 @@ def _load_tables_db(executer_instance): ...@@ -82,6 +84,7 @@ def _load_tables_db(executer_instance):
results = db.engine.execution_options(stream_results=True).execute('SELECT * FROM "{0}"'.format(table_name)) results = db.engine.execution_options(stream_results=True).execute('SELECT * FROM "{0}"'.format(table_name))
# Fetch all the results of the query # Fetch all the results of the query
# value = pd.DataFrame(iter(results),columns=results.keys()) # Pass results as an iterator # value = pd.DataFrame(iter(results),columns=results.keys()) # Pass results as an iterator
# with string_folding_wrapper we loose response time
value = pd.DataFrame(string_folding_wrapper(results),columns=results.keys()) value = pd.DataFrame(string_folding_wrapper(results),columns=results.keys())
tables[table_name] = value[[ tables[table_name] = value[[
col for col in value.columns if col.lower()[-3:] != '_id' 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