You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/06/07 11:25:39 UTC

[airflow] branch main updated: Check that edge nodes actually exist (#24166)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 3e51d8029b Check that edge nodes actually exist (#24166)
3e51d8029b is described below

commit 3e51d8029ba34d3a76b3afe53e257f1fb5fb9da1
Author: Brent Bovenzi <br...@gmail.com>
AuthorDate: Tue Jun 7 13:25:31 2022 +0200

    Check that edge nodes actually exist (#24166)
---
 airflow/www/static/js/dag_dependencies.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/airflow/www/static/js/dag_dependencies.js b/airflow/www/static/js/dag_dependencies.js
index 4e342288ef..81ba457522 100644
--- a/airflow/www/static/js/dag_dependencies.js
+++ b/airflow/www/static/js/dag_dependencies.js
@@ -198,8 +198,14 @@ const renderGraph = () => {
     g.setNode(node.id, node.value);
   });
 
+  // filter out edges that point to non-existent nodes
+  const realEdges = edges.filter((e) => {
+    const edgeNodes = nodes.filter((n) => n.id === e.u || n.id === e.v);
+    return edgeNodes.length === 2;
+  });
+
   // Set edges
-  edges.forEach((edge) => {
+  realEdges.forEach((edge) => {
     g.setEdge(edge.u, edge.v, {
       curve: d3.curveBasis,
       arrowheadClass: 'arrowhead',