Skip to content

Commit

Permalink
expose meta in Metric
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamDee committed Jan 20, 2024
1 parent bee9aaf commit e34e8fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dbt_semantic_interfaces/implementations/metric.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import List, Optional, Sequence
from typing import Any, Dict, List, Optional, Sequence

from dbt_semantic_interfaces.enum_extension import assert_values_exhausted
from dbt_semantic_interfaces.errors import ParsingException
Expand Down Expand Up @@ -180,6 +180,7 @@ class PydanticMetric(HashableBaseModel, ModelWithMetadataParsing):
filter: Optional[PydanticWhereFilterIntersection]
metadata: Optional[PydanticMetadata]
label: Optional[str] = None
meta: Dict[str, Any]

@property
def input_measures(self) -> Sequence[PydanticMetricInputMeasure]:
Expand Down
8 changes: 7 additions & 1 deletion dbt_semantic_interfaces/protocols/metric.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from abc import abstractmethod
from typing import Optional, Protocol, Sequence
from typing import Any, Dict, Optional, Protocol, Sequence

from dbt_semantic_interfaces.protocols.metadata import Metadata
from dbt_semantic_interfaces.protocols.where_filter import WhereFilterIntersection
Expand Down Expand Up @@ -280,6 +280,12 @@ def input_metrics(self) -> Sequence[MetricInput]:
def metadata(self) -> Optional[Metadata]: # noqa: D
pass

@property
@abstractmethod
def meta(self) -> Dict[str, Any]:
"""The meta field can be used to set metadata for a resource."""
pass

@property
@abstractmethod
def label(self) -> Optional[str]:
Expand Down

0 comments on commit e34e8fc

Please sign in to comment.