Design for Pandas access to Query
Over at Pandas, there's a question on the best way to load a pandas DataFrame from a SQLAlchemy Query object. https://github.com/pydata/pandas/issues/11181#issuecomment-142915059
Do you have any guidance on what the design should be? Currently something like pd.read_sql_query(Query().selectable, engine)
or pd.read_sql(query.statement, query.session.bind)
will work.
But is there a better way that we could add to pandas, vs just executing the SQL string?
Thanks
Comments (4)
-
repo owner -
reporter I think this question is simpler - given a query object, what's the best way to fill a DataFrame with its results?
Although Calchiplan is very cool
-
repo owner the query object's results come from...a real SQL database? this is just transfer data from SQL database to local pandas dataframe? Query is an iterator, would be whatever pandas thing reads tuples from iterators. No "sql" needed on the Pandas side I wouldn't think.
-
repo owner - changed status to closed
this is not a SQLAlchemy issue of any kind for discussion please email the mailing list at https://groups.google.com/forum/#!forum/sqlalchemy.
- Log in to comment
a few years ago I wrote Calchipan, does that help?