You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/03/15 07:32:54 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #22184: Add run_id and map_index to SlaMiss

uranusjr commented on a change in pull request #22184:
URL: https://github.com/apache/airflow/pull/22184#discussion_r826653317



##########
File path: airflow/api_connexion/endpoints/task_instance_endpoint.py
##########
@@ -284,16 +257,9 @@ def get_task_instances_batch(session: Session = NEW_SESSION) -> APIResponse:
     # Count elements before joining extra columns
     total_entries = base_query.with_entities(func.count('*')).scalar()
     # Add join
-    base_query = base_query.join(
-        SlaMiss,
-        and_(
-            SlaMiss.dag_id == TI.dag_id,
-            SlaMiss.task_id == TI.task_id,
-            SlaMiss.execution_date == DR.execution_date,
-        ),
-        isouter=True,
-    ).add_entity(SlaMiss)
-    ti_query = base_query.options(joinedload(TI.rendered_task_instance_fields))
+    ti_query = base_query.options(joinedload(TI.sla_miss)).options(
+        joinedload(TI.rendered_task_instance_fields)
+    )

Review comment:
       Is it possible to do
   
   ```suggestion
       ti_query = base_query.options(
           joinedload(TI.sla_miss),
           joinedload(TI.rendered_task_instance_fields),
       )
   ```
   
   ? I’d think so since the function name implies plural.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org