Below should work in most cases:
df = pd.read_sql(query.statement, query.session.bind)
See pandas.read_sql
documentation for more information on the parameters.
More Related Contents:
- How to execute raw SQL in Flask-SQLAlchemy app
- How to write DataFrame to postgres table
- jsonify a SQLAlchemy result set in Flask [duplicate]
- Flask SQLAlchemy query, specify column names
- Writing to MySQL database with pandas using SQLAlchemy, to_sql
- AttributeError: can’t set attribute when connecting to sqlite database with flask-sqlalchemy
- Case Insensitive Flask-SQLAlchemy Query
- Flask-SQLalchemy update a row’s information
- How to build a flask application around an already existing database?
- Bulk Insert A Pandas DataFrame Using SQLAlchemy
- SQLAlchemy ManyToMany secondary table with additional fields
- Can SQLAlchemy be used with Google Cloud SQL?
- Updates to JSON field don’t persist to DB
- Flask sqlalchemy many-to-many insert data
- How to delete a record by id in Flask-SQLAlchemy
- How to upsert pandas DataFrame to PostgreSQL table?
- How to upsert pandas DataFrame to Microsoft SQL Server table?
- Get inserted key before commit session
- Querying with function on Flask-SQLAlchemy model gives BaseQuery object is not callable error
- AttributeError: ‘int’ object has no attribute ‘_sa_instance_state’
- sqlalchemy.exc.NoSuchModuleError: Can’t load plugin: sqlalchemy.dialects:postgres
- SQLAlchemy – performing a bulk upsert (if exists, update, else insert) in postgresql
- Getting first row from sqlalchemy
- ImportError: No module named sqlalchemy
- Flask-SQLAlchemy Constructor
- pandas to_sql all columns as nvarchar
- Using SQLAlchemy models in and out of Flask
- Retrieve query results as dict in SQLAlchemy
- SQLAlchemy ordering by count on a many to many relationship
- pyodbc.connect() works, but not sqlalchemy.create_engine().connect()