jpkoponen commented on issue #13542:
URL: https://github.com/apache/airflow/issues/13542#issuecomment-1031198456


   > > @val2k I may know why increasing the `try_number` didn't work. The DAG 
file that @danmactough posted is missing `session.commit()` after 
`session.merge()`. After the addition, the DAG file worked as intended for me.
   > 
   > @jpkoponen At least in v2.0.2 (which is the only v2.x version available on 
AWS MWAA), there's no reason to call `session.commit()` when using the 
`@provide_session` decorator. It [creates the 
session](https://github.com/apache/airflow/blob/2.0.2/airflow/utils/session.py#L69),
 and [calls `session.commit()` for 
you](https://github.com/apache/airflow/blob/2.0.2/airflow/utils/session.py#L32).
   
   Okay, I didn't know that. In that case, I'm confused why the `try_number` 
increased with `commit()` but didn't without it. 🤷 


-- 
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