feng-tao commented on a change in pull request #4396: [AIRFLOW-3585] - Add
edges to database
URL: https://github.com/apache/airflow/pull/4396#discussion_r256957133
##########
File path: airflow/www/views.py
##########
@@ -1319,24 +1335,20 @@ def graph(self, session=None):
'rx': 5,
'ry': 5,
}
- })
-
- def get_upstream(task):
- for t in task.upstream_list:
- edge = {
- 'u': t.task_id,
- 'v': task.task_id,
- }
- if edge not in edges:
- edges.append(edge)
- get_upstream(t)
-
- for t in dag.roots:
- get_upstream(t)
-
- dt_nr_dr_data = get_date_time_num_runs_dag_runs_form_data(request,
session, dag)
- dt_nr_dr_data['arrange'] = arrange
- dttm = dt_nr_dr_data['dttm']
+ }
+ for task in task_instances
+ ]
+
+ edge_query = session.query(models.DagEdge) \
+ .filter(models.DagEdge.dag_id == show_dag_id) \
+ .filter(models.DagEdge.graph_id == dag_run.graph_id)
Review comment:
yeah, all these session.query should be a method of a model. And the view
just uses the model method.
----------------------------------------------------------------
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