You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bb...@apache.org on 2021/11/18 16:26:45 UTC

[airflow] branch Fix-undefined-graph-edges created (now 6d83a96)

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

bbovenzi pushed a change to branch Fix-undefined-graph-edges
in repository https://gitbox.apache.org/repos/asf/airflow.git.


      at 6d83a96  Fix: Do not render undefined graph edges

This branch includes the following new commits:

     new 6d83a96  Fix: Do not render undefined graph edges

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[airflow] 01/01: Fix: Do not render undefined graph edges

Posted by bb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

bbovenzi pushed a commit to branch Fix-undefined-graph-edges
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 6d83a963a9a85d60919b797b51b746c2444bd990
Author: Brent Bovenzi <br...@gmail.com>
AuthorDate: Thu Nov 18 10:24:13 2021 -0600

    Fix: Do not render undefined graph edges
    
    A user had an issue where a `targetId` was undefined and that caused the whole graph view to crash. Instead, we should check for the source and target before rendering the edge.
---
 airflow/www/static/js/graph.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/airflow/www/static/js/graph.js b/airflow/www/static/js/graph.js
index daf83dc..cebdd35 100644
--- a/airflow/www/static/js/graph.js
+++ b/airflow/www/static/js/graph.js
@@ -633,7 +633,12 @@ function expandGroup(nodeId, node) {
   edges.forEach((edge) => {
     const sourceId = mapTaskToNode.get(edge.source_id);
     const targetId = mapTaskToNode.get(edge.target_id);
-    if (sourceId !== targetId && !g.hasEdge(sourceId, targetId)) {
+    if (
+      sourceId !== targetId
+      && !g.hasEdge(sourceId, targetId)
+      && sourceId
+      && targetId
+    ) {
       g.setEdge(sourceId, targetId, {
         curve: d3.curveBasis,
         arrowheadClass: 'arrowhead',