diff --git a/src/dsdk/persistor.py b/src/dsdk/persistor.py index baef7c2..4a829c8 100644 --- a/src/dsdk/persistor.py +++ b/src/dsdk/persistor.py @@ -138,8 +138,8 @@ def df_from_query_by_keys( with NamedTemporaryFile("w", delete=False, suffix=".sql") as fout: fout.write(rendered) cur.execute(rendered) - rows = cur.fetchall() columns = (each[0] for each in cur.description) + rows = cur.fetchall() if rows: df = DataFrame(rows) df.columns = columns