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


##########
airflow/models/taskinstance.py:
##########
@@ -1521,7 +1524,25 @@ 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:
+                        dataset = Dataset(uri=obj.uri, extra=obj.extra)
+                        self.log.debug("adding dataset %s", dataset)
+                        session.add(dataset)
+                        session.flush()

Review Comment:
   probably true... maybe in the mapped case?   i suppose we could chop the 
defensiveness until it's apparent that it is required



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