One option would be to replace

result_set = session.query(cls.column_1)

with

result_set = session.execute(select(cls.column_1)).mappings().all()


On Tuesday, August 31, 2021 at 1:10:17 PM UTC-6 thequie...@gmail.com wrote:

>
> Creating a pandas dataframe that contained descriptive column names 
> formerly was as easy as:
>
> result_set = session.query(cls.column_1)
> df = pandas.Dataframe(result_set)
> print df.column_1
>
> but while this works in 1.3.20, in later versions of SA such as 1.4.19,  
> there is not enough column info supplied by SA to form the same symbolic 
> column names. Thus, the above code would fail when attempting to access 
> df.column_1 in SA 1.4.19 but not fail in SA 1.3.20.
>
> Anyway to supply a flag to query() to provide the extra column that 
> existed in older SA versions?
>
>

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/5cdb2d1c-9c4f-4363-abca-27d54a7b589en%40googlegroups.com.

Reply via email to