From 005aa3d7616e6ce46e4d6de6316d017fdd5dddff Mon Sep 17 00:00:00 2001 From: popcorny Date: Fri, 21 Jun 2024 09:36:13 +0800 Subject: [PATCH] Add snapshot in the lineage Signed-off-by: popcorny --- js/src/components/lineage/NodeView.tsx | 3 ++- js/src/components/lineage/styles.tsx | 4 +++- recce/adapter/dbt_adapter/__init__.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/js/src/components/lineage/NodeView.tsx b/js/src/components/lineage/NodeView.tsx index f0c614a1..8318b25f 100644 --- a/js/src/components/lineage/NodeView.tsx +++ b/js/src/components/lineage/NodeView.tsx @@ -49,7 +49,8 @@ export function NodeView({ node, onCloseNode }: NodeViewProps) { const withColumns = node.resourceType === "model" || node.resourceType === "seed" || - node.resourceType === "source"; + node.resourceType === "source" || + node.resourceType === "snapshot"; const { isOpen: isCodeDiffOpen, onOpen: onCodeDiffOpen, diff --git a/js/src/components/lineage/styles.tsx b/js/src/components/lineage/styles.tsx index c95cac96..6807dae8 100644 --- a/js/src/components/lineage/styles.tsx +++ b/js/src/components/lineage/styles.tsx @@ -1,5 +1,5 @@ import { VscDiffAdded, VscDiffModified, VscDiffRemoved } from "react-icons/vsc"; -import { FaCube, FaDatabase, FaSeedling } from "react-icons/fa"; +import { FaCamera, FaCube, FaDatabase, FaSeedling } from "react-icons/fa"; import { FaChartSimple, FaCircleNodes, FaGauge } from "react-icons/fa6"; export const IconAdded = VscDiffAdded; @@ -89,6 +89,8 @@ export function getIconForResourceType(resourceType?: string): { return { color: "#fb8caf", icon: FaCircleNodes }; } else if (resourceType === "seed") { return { color: "#a6dda6", icon: FaSeedling }; + } else if (resourceType === "snapshot") { + return { color: "#a6dda6", icon: FaCamera }; } else { return { color: "inherit", icon: undefined }; } diff --git a/recce/adapter/dbt_adapter/__init__.py b/recce/adapter/dbt_adapter/__init__.py index 765d7804..013d8495 100644 --- a/recce/adapter/dbt_adapter/__init__.py +++ b/recce/adapter/dbt_adapter/__init__.py @@ -398,7 +398,7 @@ def get_lineage(self, base: Optional[bool] = False): unique_id = node['unique_id'] resource_type = node['resource_type'] - if resource_type not in ['model', 'seed', 'exposure']: + if resource_type not in ['model', 'seed', 'exposure', 'snapshot']: continue nodes[unique_id] = {