-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move `ExposureType` to dbt/artifacts * Move `MaturityType` to dbt/artifacts * Move `ExposureConfig` to dbt/artifacts * Move data parts of `Exposure` node class to dbt/artifacts * Update leftover incorrect imports of `Owner` resource There were a few places in the code base that were importing `Owner` from `unparsed` or `nodes`. The places importing from `unparsed` were working because `unparsed` itself was correctly importing from `artifacts.resources`. However in places where it was being imported from `nodes`, an exception was being raised because in the previous commit we removed the import of `Owner` in `nodes` because it was no longer needed.
- Loading branch information
Showing
14 changed files
with
80 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Under the Hood | ||
body: Move data parts of `Exposure` class to dbt/artifacts | ||
time: 2024-01-30T16:16:37.176038-08:00 | ||
custom: | ||
Author: QMalcolm | ||
Issue: "9380" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from dataclasses import dataclass, field | ||
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.owner import Owner | ||
from dbt_common.contracts.config.base import BaseConfig | ||
from dbt_common.dataclass_schema import StrEnum | ||
import time | ||
from typing import Any, Dict, List, Literal, Optional | ||
|
||
|
||
class ExposureType(StrEnum): | ||
Dashboard = "dashboard" | ||
Notebook = "notebook" | ||
Analysis = "analysis" | ||
ML = "ml" | ||
Application = "application" | ||
|
||
|
||
class MaturityType(StrEnum): | ||
Low = "low" | ||
Medium = "medium" | ||
High = "high" | ||
|
||
|
||
@dataclass | ||
class ExposureConfig(BaseConfig): | ||
enabled: bool = True | ||
|
||
|
||
@dataclass | ||
class Exposure(GraphResource): | ||
type: ExposureType | ||
owner: Owner | ||
resource_type: Literal[NodeType.Exposure] | ||
description: str = "" | ||
label: Optional[str] = None | ||
maturity: Optional[MaturityType] = None | ||
meta: Dict[str, Any] = field(default_factory=dict) | ||
tags: List[str] = field(default_factory=list) | ||
config: ExposureConfig = field(default_factory=ExposureConfig) | ||
unrendered_config: Dict[str, Any] = field(default_factory=dict) | ||
url: Optional[str] = None | ||
depends_on: DependsOn = field(default_factory=DependsOn) | ||
refs: List[RefArgs] = field(default_factory=list) | ||
sources: List[List[str]] = field(default_factory=list) | ||
metrics: List[List[str]] = field(default_factory=list) | ||
created_at: float = field(default_factory=lambda: time.time()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters