-
Notifications
You must be signed in to change notification settings - Fork 14
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 dimension_dot_grain_support
- Loading branch information
Showing
21 changed files
with
491 additions
and
13 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: Add New SavedQuery Protocol | ||
time: 2023-09-13T17:27:54.018355-07:00 | ||
custom: | ||
Author: plypaul | ||
Issue: "144" |
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: Disallow dunders semantic object names | ||
time: 2023-09-14T13:47:08.907492-07:00 | ||
custom: | ||
Author: QMalcolm | ||
Issue: "149" |
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,32 @@ | ||
from __future__ import annotations | ||
|
||
from typing import List, Optional | ||
|
||
from typing_extensions import override | ||
|
||
from dbt_semantic_interfaces.implementations.base import ( | ||
HashableBaseModel, | ||
ModelWithMetadataParsing, | ||
) | ||
from dbt_semantic_interfaces.implementations.filters.where_filter import ( | ||
PydanticWhereFilter, | ||
) | ||
from dbt_semantic_interfaces.implementations.metadata import PydanticMetadata | ||
from dbt_semantic_interfaces.protocols import ProtocolHint | ||
from dbt_semantic_interfaces.protocols.saved_query import SavedQuery | ||
|
||
|
||
class PydanticSavedQuery(HashableBaseModel, ModelWithMetadataParsing, ProtocolHint[SavedQuery]): | ||
"""Pydantic implementation of SavedQuery.""" | ||
|
||
@override | ||
def _implements_protocol(self) -> SavedQuery: | ||
return self | ||
|
||
name: str | ||
metrics: List[str] | ||
group_bys: List[str] = [] | ||
where: List[PydanticWhereFilter] = [] | ||
|
||
description: Optional[str] = None | ||
metadata: Optional[PydanticMetadata] = 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from abc import abstractmethod | ||
from typing import Optional, Protocol, Sequence | ||
|
||
from dbt_semantic_interfaces.protocols.metadata import Metadata | ||
from dbt_semantic_interfaces.protocols.where_filter import WhereFilter | ||
|
||
|
||
class SavedQuery(Protocol): | ||
"""Represents a query that the user wants to run repeatedly.""" | ||
|
||
@property | ||
@abstractmethod | ||
def metadata(self) -> Optional[Metadata]: # noqa: D | ||
pass | ||
|
||
@property | ||
@abstractmethod | ||
def name(self) -> str: # noqa: D | ||
pass | ||
|
||
@property | ||
@abstractmethod | ||
def description(self) -> Optional[str]: # noqa: D | ||
pass | ||
|
||
@property | ||
@abstractmethod | ||
def metrics(self) -> Sequence[str]: # noqa: D | ||
pass | ||
|
||
@property | ||
@abstractmethod | ||
def group_bys(self) -> Sequence[str]: # noqa: D | ||
pass | ||
|
||
@property | ||
@abstractmethod | ||
def where(self) -> Sequence[WhereFilter]: # noqa: D | ||
pass |
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
Oops, something went wrong.