Skip to content

Commit

Permalink
Merge pull request #351 from DataRecce/cherrypick/feature/drc-511-add…
Browse files Browse the repository at this point in the history
…-snapshot-node-in-lineage

Add snapshot in the lineage
  • Loading branch information
popcornylu authored Jun 21, 2024
2 parents e3388fe + 005aa3d commit f3f438f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion js/src/components/lineage/NodeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 3 additions & 1 deletion js/src/components/lineage/styles.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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 };
}
Expand Down
2 changes: 1 addition & 1 deletion recce/adapter/dbt_adapter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down

0 comments on commit f3f438f

Please sign in to comment.