Skip to content

Commit

Permalink
Add meta to dimensions, entities, and measures (#1561)
Browse files Browse the repository at this point in the history
This PR adds meta config to dimensions, entities, and measures. This is
modeled off of
[this](https://github.com/dbt-labs/metricflow/pull/1334/files) PR.
  • Loading branch information
DevonFulcher authored Dec 10, 2024
1 parent cd330b8 commit 1f5710d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20241210-110613.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Add meta to dimensions, entities, and measures
time: 2024-12-10T11:06:13.310255-06:00
custom:
Author: DevonFulcher
Issue: None
5 changes: 5 additions & 0 deletions metricflow/engine/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class Dimension:
entity_links: Tuple[EntityReference, ...]
type_params: Optional[DimensionTypeParams]
metadata: Optional[Metadata]
config: Optional[SemanticLayerElementConfig] = None
is_partition: bool = False
expr: Optional[str] = None
label: Optional[str] = None
Expand All @@ -112,6 +113,7 @@ def from_pydantic(
type=pydantic_dimension.type,
type_params=parsed_type_params,
metadata=pydantic_dimension.metadata,
config=pydantic_dimension.config,
is_partition=pydantic_dimension.is_partition,
expr=pydantic_dimension.expr,
label=pydantic_dimension.label,
Expand Down Expand Up @@ -142,6 +144,7 @@ class Entity:
description: Optional[str]
type: EntityType
role: Optional[str]
config: Optional[SemanticLayerElementConfig] = None
expr: Optional[str] = None

@classmethod
Expand All @@ -152,6 +155,7 @@ def from_pydantic(cls, pydantic_entity: SemanticManifestEntity) -> Entity:
description=pydantic_entity.description,
type=pydantic_entity.type,
role=pydantic_entity.role,
config=pydantic_entity.config,
expr=pydantic_entity.expr,
)

Expand All @@ -163,6 +167,7 @@ class Measure:
name: str
agg: AggregationType
agg_time_dimension: str
config: Optional[SemanticLayerElementConfig] = None
description: Optional[str] = None
expr: Optional[str] = None
agg_params: Optional[MeasureAggregationParameters] = None
Expand Down

0 comments on commit 1f5710d

Please sign in to comment.