Taragolis commented on code in PR #38297:
URL: https://github.com/apache/airflow/pull/38297#discussion_r1531029060


##########
airflow/models/taskinstance.py:
##########
@@ -1839,6 +1839,35 @@ def key(self) -> TaskInstanceKey:
         """Returns a tuple that identifies the task instance uniquely."""
         return TaskInstanceKey(self.dag_id, self.task_id, self.run_id, 
self.try_number, self.map_index)
 
+    @staticmethod
+    @internal_api_call
+    def _set_state(ti: TaskInstance | TaskInstancePydantic, state, session: 
Session) -> bool:
+        TI = TaskInstance
+        if not isinstance(ti, TaskInstance):
+            ti = (
+                session.query(TI)

Review Comment:
   [Query API](https://docs.sqlalchemy.org/en/20/orm/queryguide/query.html) is 
deprecated in SQLAlchemy, could we use 
[session.execute](https://docs.sqlalchemy.org/en/14/orm/session_api.html#sqlalchemy.orm.Session.execute)
 here ?



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