dstandish commented on code in PR #32646:
URL: https://github.com/apache/airflow/pull/32646#discussion_r1317864670
##########
airflow/models/taskinstance.py:
##########
@@ -895,6 +895,19 @@ def refresh_from_db(self, session: Session = NEW_SESSION,
lock_for_update: bool
else:
self.state = None
+ @classmethod
+ def get_by_key(cls, ti_key, session) -> TaskInstance:
+ return (
+ session.query(TaskInstance)
+ .filter(
+ TaskInstance.task_id == ti_key.task_id,
+ TaskInstance.dag_id == ti_key.dag_id,
+ TaskInstance.run_id == ti_key.run_id,
+ TaskInstance.map_index == ti_key.map_index,
+ )
+ .one_or_none()
+ )
Review Comment:
What would you propose? Where should this logic go? This exists so that
`_render_filename` can accept either TI or TI Key. Would you just inline it in
_render_filename?
--
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]