ephraimbuddy commented on code in PR #24743:
URL: https://github.com/apache/airflow/pull/24743#discussion_r912750586


##########
airflow/models/taskinstance.py:
##########
@@ -1521,7 +1524,17 @@ def _run_raw_task(
         if not test_mode:
             session.add(Log(self.state, self))
             session.merge(self)
-
+            for obj in getattr(self.task, '_outlets', []):
+                self.log.debug("outlet obj %s", obj)
+                if isinstance(obj, Dataset):
+                    dataset = session.query(Dataset).filter(Dataset.uri == 
obj.uri).first()
+                    if not dataset:
+                        self.log.warning("Dataset %s not found", dataset)
+                        continue
+                    downstream_dag_ids = [x.dag_id for x in 
dataset.dag_references]
+                    self.log.debug("downstream dag ids %s", downstream_dag_ids)
+                    for dag_id in downstream_dag_ids:
+                        
session.merge(DatasetDagRunQueue(dataset_id=dataset.id, target_dag_id=dag_id))

Review Comment:
   Probably extract this into a private method on the task instance to run this?



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