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



##########
File path: airflow/dag_processing/processor.py
##########
@@ -412,20 +411,19 @@ def manage_slas(self, dag: DAG, session: Session = None) 
-> None:
             else:
                 while next_info.logical_date < ts:
                     next_info = dag.next_dagrun_info(next_info.data_interval, 
restricted=False)
-
                     if next_info is None:
                         break
-                    if (ti.dag_id, ti.task_id, next_info.logical_date) in 
recorded_slas_query:
+                    if (ti.dag_id, ti.task_id, ti.run_id, ti.map_index) in 
recorded_sla_misses:

Review comment:
       yeah i had it that way originally, and the tests were failing due to 
referential integrity errors.  and the reason is because the TI did not exist.  
but that is expected with SLAs.  so we can't add a FK for SLA->TI unless we 
make `manage_slas` _also_ create the TI.
   
   For now [here's a PR](https://github.com/apache/airflow/pull/22214) that 
makes an sla test a little stricter to document *which* sla miss is created, 
and not just *that* an sla miss is created.
   
   And I guess for now I'll remove the FK and update the code.




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