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/06/30 18:22:54 UTC

[GitHub] [airflow] dstandish commented on a diff in pull request #24743: WIP Add other dataset models -- dag-based dataset deps

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

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