uranusjr commented on code in PR #41384:
URL: https://github.com/apache/airflow/pull/41384#discussion_r1726181192


##########
airflow/api/common/mark_tasks.py:
##########
@@ -164,7 +164,7 @@ def get_all_dag_task_query(
     qry_dag = select(TaskInstance).where(
         TaskInstance.dag_id == dag.dag_id,
         TaskInstance.run_id.in_(run_ids),
-        TaskInstance.ti_selector_condition(task_ids),
+        TaskInstance.ti_selector_condition(task_ids, session=session),

Review Comment:
   My point is that the method _should not_ do a fetch in the first place. The 
method calculates filtering parameters for a query. Using another query to do 
that is not a generally preferred approach since it makes it difficult to 
manage where queries happen. It would be best if the multiple queries can be 
combined into one with JOIN or other SQL constructs, or, if that is not viable, 
the queries should at least happen in the same function, not in different 
levels in the call stack.



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