ffinfo commented on a change in pull request #4396: [AIRFLOW-3585] - Add edges
to database
URL: https://github.com/apache/airflow/pull/4396#discussion_r257133588
##########
File path: airflow/models/__init__.py
##########
@@ -4012,17 +4088,55 @@ def create_dagrun(self,
conf=conf,
state=state
)
+
+ dag_model = DagModel.get_dagmodel(self.dag_id)
+
+ tis = self.create_tis(execution_date)
+ edges = self.create_edges(-1)
+
+ last_run = dag_model.get_last_dagrun(include_externally_triggered=True)
+ if last_run is None:
+ same = False
+ else:
+ last_edges = DagEdge.fetch_edges_db(self.dag_id, last_run.graph_id)
+
+ # Compare edges from last run
+ same = True
+ if len(last_edges) != len(edges):
+ same = False
+ else:
+ e1 = set([(edge.from_task, edge.to_task) for edge in
last_edges])
Review comment:
no that does not matter, so a set here is the easiest
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services