Skip to content

Commit

Permalink
add saved query resource type (#10168)
Browse files Browse the repository at this point in the history
* add saved query resource type

* nits

(cherry picked from commit 6813007)
  • Loading branch information
ChenyuLInx committed May 22, 2024
1 parent bdca6b5 commit cf46a68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20240516-223510.yaml
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 8 additions & 2 deletions core/dbt/artifacts/resources/v1/saved_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
import time

from dataclasses import dataclass, field
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,
WhereFilterIntersection,
)
from dbt_common.contracts.config.base import BaseConfig, CompareBehavior, MergeBehavior
from dbt_common.dataclass_schema import dbtClassMixin
from dbt_semantic_interfaces.type_enums.export_destination_type import ExportDestinationType
from typing import Any, Dict, List, Optional


@dataclass
Expand Down Expand Up @@ -78,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
Expand Down

0 comments on commit cf46a68

Please sign in to comment.