From 6b465ce82a9719e90cd9613aa6bfaba63157b54c Mon Sep 17 00:00:00 2001 From: Chenyu Li Date: Thu, 16 May 2024 22:32:51 -0700 Subject: [PATCH 1/2] add saved query resource type --- core/dbt/artifacts/resources/v1/saved_query.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/dbt/artifacts/resources/v1/saved_query.py b/core/dbt/artifacts/resources/v1/saved_query.py index 379ae940e10..8b024682a0f 100644 --- a/core/dbt/artifacts/resources/v1/saved_query.py +++ b/core/dbt/artifacts/resources/v1/saved_query.py @@ -2,13 +2,14 @@ import time from dataclasses import dataclass, field -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Literal, Optional from dbt_semantic_interfaces.type_enums.export_destination_type import ( ExportDestinationType, ) from dbt.artifacts.resources.base import GraphResource +from dbt.artifacts.resources.types import NodeType from dbt.artifacts.resources.v1.components import DependsOn, RefArgs from dbt.artifacts.resources.v1.semantic_layer_components import ( SourceFileMetadata, @@ -82,6 +83,7 @@ class SavedQueryMandatory(GraphResource): @dataclass class SavedQuery(SavedQueryMandatory): + resource_type: Literal[NodeType.SavedQuery] description: Optional[str] = None label: Optional[str] = None metadata: Optional[SourceFileMetadata] = None From 2a828dbad5903759a50f0db07221290fe758e4b3 Mon Sep 17 00:00:00 2001 From: Chenyu Li Date: Thu, 16 May 2024 22:35:15 -0700 Subject: [PATCH 2/2] nits --- .changes/unreleased/Fixes-20240516-223510.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Fixes-20240516-223510.yaml diff --git a/.changes/unreleased/Fixes-20240516-223510.yaml b/.changes/unreleased/Fixes-20240516-223510.yaml new file mode 100644 index 00000000000..53a0e553e7f --- /dev/null +++ b/.changes/unreleased/Fixes-20240516-223510.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Add resource type to saved_query +time: 2024-05-16T22:35:10.287514-07:00 +custom: + Author: ChenyuLInx + Issue: "10168"