-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into gs/list_unit_tests
- Loading branch information
Showing
82 changed files
with
1,184 additions
and
444 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: Features | ||
body: Enable unit testing versioned models | ||
time: 2024-01-22T14:58:54.251484-05:00 | ||
custom: | ||
Author: gshank | ||
Issue: "9344" |
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: Fixes | ||
body: Fix retry command run from CLI | ||
time: 2024-01-24T14:25:22.846199-08:00 | ||
custom: | ||
Author: ChenyuLInx | ||
Issue: "9444" |
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: dbt Labs OSS standardization of docs and templates. | ||
time: 2024-01-09T09:18:56.686698+11:00 | ||
custom: | ||
Author: tonayya | ||
Issue: "9252" |
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 WritableManifest + Documentation to dbt/artifacts | ||
time: 2024-01-23T14:22:56.488252-05:00 | ||
custom: | ||
Author: michelleark | ||
Issue: 9378 9379 |
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: Define Macro and Group resources in dbt/artifacts | ||
time: 2024-01-25T09:54:53.974332-05:00 | ||
custom: | ||
Author: michelleark | ||
Issue: 9381 9382 |
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
Empty file.
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,8 @@ | ||
from dbt.artifacts.resources.base import BaseResource | ||
|
||
# alias to latest resource definitions | ||
from dbt.artifacts.resources.v1.documentation import Documentation | ||
from dbt.artifacts.resources.v1.macro import Macro, MacroDependsOn, MacroArgument | ||
from dbt.artifacts.resources.v1.docs import Docs | ||
from dbt.artifacts.resources.v1.group import Group | ||
from dbt.artifacts.resources.v1.owner import Owner |
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,15 @@ | ||
from dataclasses import dataclass | ||
from dbt_common.dataclass_schema import dbtClassMixin | ||
from dbt_common.contracts.util import Replaceable | ||
|
||
from dbt.artifacts.resources.types import NodeType | ||
|
||
|
||
@dataclass | ||
class BaseResource(dbtClassMixin, Replaceable): | ||
name: str | ||
resource_type: NodeType | ||
package_name: str | ||
path: str | ||
original_file_path: str | ||
unique_id: str |
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,54 @@ | ||
from dbt_common.dataclass_schema import StrEnum | ||
|
||
|
||
class AccessType(StrEnum): | ||
Private = "private" | ||
Protected = "protected" | ||
Public = "public" | ||
|
||
@classmethod | ||
def is_valid(cls, item): | ||
try: | ||
cls(item) | ||
except ValueError: | ||
return False | ||
return True | ||
|
||
|
||
class NodeType(StrEnum): | ||
Model = "model" | ||
Analysis = "analysis" | ||
Test = "test" | ||
Snapshot = "snapshot" | ||
Operation = "operation" | ||
Seed = "seed" | ||
# TODO: rm? | ||
RPCCall = "rpc" | ||
SqlOperation = "sql_operation" | ||
Documentation = "doc" | ||
Source = "source" | ||
Macro = "macro" | ||
Exposure = "exposure" | ||
Metric = "metric" | ||
Group = "group" | ||
SavedQuery = "saved_query" | ||
SemanticModel = "semantic_model" | ||
Unit = "unit_test" | ||
Fixture = "fixture" | ||
|
||
def pluralize(self) -> str: | ||
if self is self.Analysis: | ||
return "analyses" | ||
elif self is self.SavedQuery: | ||
return "saved_queries" | ||
return f"{self}s" | ||
|
||
|
||
class RunHookType(StrEnum): | ||
Start = "on-run-start" | ||
End = "on-run-end" | ||
|
||
|
||
class ModelLanguage(StrEnum): | ||
python = "python" | ||
sql = "sql" |
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,10 @@ | ||
from dataclasses import dataclass | ||
from dbt_common.dataclass_schema import dbtClassMixin | ||
from dbt_common.contracts.util import Replaceable | ||
from typing import Optional | ||
|
||
|
||
@dataclass | ||
class Docs(dbtClassMixin, Replaceable): | ||
show: bool = True | ||
node_color: Optional[str] = None |
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,11 @@ | ||
from dataclasses import dataclass | ||
from typing import Literal | ||
|
||
from dbt.artifacts.resources.base import BaseResource | ||
from dbt.artifacts.resources.types import NodeType | ||
|
||
|
||
@dataclass | ||
class Documentation(BaseResource): | ||
resource_type: Literal[NodeType.Documentation] | ||
block_contents: str |
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,13 @@ | ||
from dataclasses import dataclass | ||
from typing import Literal | ||
|
||
from dbt.artifacts.resources.base import BaseResource | ||
from dbt.artifacts.resources.types import NodeType | ||
from dbt.artifacts.resources.v1.owner import Owner | ||
|
||
|
||
@dataclass | ||
class Group(BaseResource): | ||
name: str | ||
owner: Owner | ||
resource_type: Literal[NodeType.Group] |
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,40 @@ | ||
from dataclasses import dataclass, field | ||
import time | ||
from typing import Literal, List, Dict, Optional, Any | ||
|
||
from dbt_common.contracts.util import Replaceable | ||
from dbt_common.dataclass_schema import dbtClassMixin | ||
from dbt.artifacts.resources.base import BaseResource | ||
from dbt.artifacts.resources.types import NodeType, ModelLanguage | ||
from dbt.artifacts.resources.v1.docs import Docs | ||
|
||
|
||
@dataclass | ||
class MacroArgument(dbtClassMixin): | ||
name: str | ||
type: Optional[str] = None | ||
description: str = "" | ||
|
||
|
||
@dataclass | ||
class MacroDependsOn(dbtClassMixin, Replaceable): | ||
macros: List[str] = field(default_factory=list) | ||
|
||
# 'in' on lists is O(n) so this is O(n^2) for # of macros | ||
def add_macro(self, value: str): | ||
if value not in self.macros: | ||
self.macros.append(value) | ||
|
||
|
||
@dataclass | ||
class Macro(BaseResource): | ||
macro_sql: str | ||
resource_type: Literal[NodeType.Macro] | ||
depends_on: MacroDependsOn = field(default_factory=MacroDependsOn) | ||
description: str = "" | ||
meta: Dict[str, Any] = field(default_factory=dict) | ||
docs: Docs = field(default_factory=Docs) | ||
patch_path: Optional[str] = None | ||
arguments: List[MacroArgument] = field(default_factory=list) | ||
created_at: float = field(default_factory=lambda: time.time()) | ||
supported_languages: Optional[List[ModelLanguage]] = None |
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,11 @@ | ||
from dataclasses import dataclass | ||
from typing import Optional | ||
|
||
from dbt_common.contracts.config.properties import AdditionalPropertiesAllowed | ||
from dbt_common.contracts.util import Replaceable | ||
|
||
|
||
@dataclass | ||
class Owner(AdditionalPropertiesAllowed, Replaceable): | ||
email: Optional[str] = None | ||
name: Optional[str] = None |
Empty file.
File renamed without changes.
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,2 @@ | ||
# alias to latest | ||
from dbt.artifacts.schemas.catalog.v1.catalog import * # noqa |
Empty file.
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 @@ | ||
from dbt.artifacts.schemas.freshness.v3.freshness import * # noqa |
Empty file.
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,2 @@ | ||
# alias to latest | ||
from dbt.artifacts.schemas.manifest.v12.manifest import * # noqa |
Empty file.
Oops, something went wrong.