Design for Pandas access to Query

Issue #3542 closed
Maximilian Roos created an issue

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?

SO question

Thanks

Comments (4)

  1. Maximilian Roos 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

  2. Mike Bayer 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.

  3. Log in to comment