dondaum commented on PR #39299:
URL: https://github.com/apache/airflow/pull/39299#issuecomment-2091893084

   Oh interesting. Due to your comment I looked again in the SQL Alchemy 
[docs](https://docs.sqlalchemy.org/en/20/changelog/migration_14.html#change-5150)
 
   
   I thought we have enabled already SQA 2.0 style by setting future=True in 
the engine 
[here](https://github.com/apache/airflow/blob/495814e908890763d9429df7ad9f4f33908fef98/airflow/settings.py#L293)
 but it seems that this enables 2.0 style of engines and connections only. Yet 
for the ORM, to anble future behavior in the ORM Sessions we also need to pass 
future=True in the [sessionmaker 
](https://docs.sqlalchemy.org/en/14/core/future.html) object.
   
   ```Python
       Session = scoped_session(
           sessionmaker(
               autocommit=False,
               autoflush=False,
               bind=engine,
               expire_on_commit=False,
               future=True
           )
       )
   ```
   
   If I do the warnings disapear. If I remove my fixes the tests fail. So it 
seems that is pretty usefull to test if the changes / fixes work and it might 
makes in general sense to set future=True also for the ORM session ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to