Re: [sqlalchemy] Why was the column information stripped away in SA 1.4.20 that existed in 1.3.20?

2021-09-01 Thread Mike Bayer
this is then the diffeence between tuples and dicts call pandas like this: DataFrame(result.mappings()) that will give it a series of dicts rather than tuples for rows On Wed, Sep 1, 2021, at 8:04 AM, Gord Thompson wrote: > Another workaround would be … > > df =

Re: [sqlalchemy] Why was the column information stripped away in SA 1.4.20 that existed in 1.3.20?

2021-09-01 Thread Gord Thompson
Another workaround would be … df = pd.read_sql_query(select(User.id, User.name), engine) print(df) """ id name 0 1 Gord 1 2 Bob """ … although it does produce a couple of RemovedIn20Warning messages (that will probably be resolved once pandas does SQLA 1.4 better). On Wednesday,

Re: [sqlalchemy] Why was the column information stripped away in SA 1.4.20 that existed in 1.3.20?

2021-09-01 Thread Terrence-Monroe: Brannon
Just for completeness I'm linking to source code to reproduce the problem: play/sqlalchemy-and-pandas at main · metaperl/play (github.com) Looks like the 1.4 release of pandas will remedy this problem. On Wednesday, September

Re: [sqlalchemy] Why was the column information stripped away in SA 1.4.20 that existed in 1.3.20?

2021-09-01 Thread Federico Caselli
Hi, This is a pandas bug, not an sqlalchemy ones. It was already reported here https://github.com/pandas-dev/pandas/issues/40682 On Tuesday, 31 August 2021 at 23:15:04 UTC+2 Gord Thompson wrote: > *With version 1.3:* > > Base = declarative_base() > > > class User(Base): > __tablename__ =

Re: [sqlalchemy] Why was the column information stripped away in SA 1.4.20 that existed in 1.3.20?

2021-08-31 Thread Gord Thompson
*With version 1.3:* Base = declarative_base() class User(Base): __tablename__ = "user" id = Column(Integer, primary_key=True) name = Column(String) Base.metadata.create_all(engine) print(pd.__version__) # 1.3.2 print(sa.__version__) # 1.3.24 session = Session(engine)

Re: [sqlalchemy] Why was the column information stripped away in SA 1.4.20 that existed in 1.3.20?

2021-08-31 Thread Mike Bayer
On Tue, Aug 31, 2021, at 3:10 PM, Terrence-Monroe: Brannon 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

[sqlalchemy] Why was the column information stripped away in SA 1.4.20 that existed in 1.3.20?

2021-08-31 Thread Terrence-Monroe: Brannon
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