potiuk commented on code in PR #25312:
URL: https://github.com/apache/airflow/pull/25312#discussion_r930336561
##########
airflow/models/taskinstance.py:
##########
@@ -848,11 +848,15 @@ def refresh_from_db(self, session: Session = NEW_SESSION,
lock_for_update: bool
"""
self.log.debug("Refreshing TaskInstance %s from DB", self)
- qry = session.query(TaskInstance).filter(
- TaskInstance.dag_id == self.dag_id,
- TaskInstance.task_id == self.task_id,
- TaskInstance.run_id == self.run_id,
- TaskInstance.map_index == self.map_index,
+ qry = (
+ session.query(TaskInstance)
+ .filter(
+ TaskInstance.dag_id == self.dag_id,
+ TaskInstance.task_id == self.task_id,
+ TaskInstance.run_id == self.run_id,
+ TaskInstance.map_index == self.map_index,
+ )
Review Comment:
I guess (from the discussion) this "feature" of SQL of locking the other
side is kinda undocumented and dangerous ... and something unexpected as welll
(breakes the "explicit is better than implicit" zen of Python) so I am afraid
we might not find a "nicer" way of disabling it, because it feels like a hack.
--
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]