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

bbovenzi 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 76295d3d25 Hide upstream dataset edges in dag graph (#38338)
76295d3d25 is described below

commit 76295d3d25653b1d758ff8a62292227c575808d0
Author: Brent Bovenzi <[email protected]>
AuthorDate: Wed Mar 20 11:40:56 2024 -0700

    Hide upstream dataset edges in dag graph (#38338)
---
 airflow/www/static/js/components/Graph/Edge.tsx   | 2 ++
 airflow/www/static/js/dag/details/graph/index.tsx | 1 +
 airflow/www/static/js/types/index.ts              | 2 ++
 airflow/www/static/js/utils/graph.ts              | 1 +
 4 files changed, 6 insertions(+)

diff --git a/airflow/www/static/js/components/Graph/Edge.tsx 
b/airflow/www/static/js/components/Graph/Edge.tsx
index 99b6259055..b51ee77c12 100644
--- a/airflow/www/static/js/components/Graph/Edge.tsx
+++ b/airflow/www/static/js/components/Graph/Edge.tsx
@@ -32,6 +32,8 @@ const CustomEdge = ({ data }: EdgeProps) => {
   const { colors } = useTheme();
   if (!data) return null;
   const { rest } = data;
+  // We can not actually say a dataset is upstream of a particular task so do 
not render the edge
+  if (rest.isSourceDataset) return null;
   let strokeWidth = 2;
   if (rest.isSelected) strokeWidth = 3;
   if (rest.isZoomedOut) strokeWidth = 5;
diff --git a/airflow/www/static/js/dag/details/graph/index.tsx 
b/airflow/www/static/js/dag/details/graph/index.tsx
index 3f34b86c73..d7445f189a 100644
--- a/airflow/www/static/js/dag/details/graph/index.tsx
+++ b/airflow/www/static/js/dag/details/graph/index.tsx
@@ -115,6 +115,7 @@ const Graph = ({
           sourceId: dataset.id.toString(),
           // Point upstream datasets to the first task
           targetId: data.nodes?.children[0].id,
+          isSourceDataset: true,
         });
       }
     }
diff --git a/airflow/www/static/js/types/index.ts 
b/airflow/www/static/js/types/index.ts
index 926db4760d..cf97aa8e04 100644
--- a/airflow/www/static/js/types/index.ts
+++ b/airflow/www/static/js/types/index.ts
@@ -166,6 +166,7 @@ export interface EdgeData {
     isSetupTeardown?: boolean;
     parentNode?: string;
     isZoomedOut?: boolean;
+    isSourceDataset?: boolean;
   };
 }
 
@@ -181,6 +182,7 @@ export interface WebserverEdge {
   targetId: string;
   isSetupTeardown?: boolean;
   parentNode?: string;
+  isSourceDataset?: boolean;
 }
 
 interface DatasetListItem extends API.Dataset {
diff --git a/airflow/www/static/js/utils/graph.ts 
b/airflow/www/static/js/utils/graph.ts
index d1b4b47bde..7db3767994 100644
--- a/airflow/www/static/js/utils/graph.ts
+++ b/airflow/www/static/js/utils/graph.ts
@@ -74,6 +74,7 @@ const formatEdge = (e: WebserverEdge, font: string, node?: 
DepNode) => ({
   targets: [e.targetId],
   isSetupTeardown: e.isSetupTeardown,
   parentNode: node?.id,
+  isSourceDataset: e.isSourceDataset,
   labels: e.label
     ? [
         {

Reply via email to