Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meta to dimensions, entities, and measures #1561

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading