From 7740bd6b45b8a19cb5910fb1221bb7ed6d5e9e5d Mon Sep 17 00:00:00 2001 From: Quigley Malcolm Date: Tue, 11 Jul 2023 09:36:10 -0700 Subject: [PATCH] Remove `create_metric` as a public facing `SemanticModel.Measure` property (#8068) * Remove `create_metric` as a public facing `SemanticModel.Measure` property We want to add `create_metric`. The `create_metric` property will be incredibly useful. However, at this time it is not hooked up, and we don't have time to hook it up before the code freeze for 1.6.0rc of core. As it doesn't do anything, we shouldn't allow people to specify it, because it won't do what one would expect. We plan on making the implementation of `create_metric` a priority for 1.7 of core * Changie doc for the removal of create_metric property --- .changes/unreleased/Fixes-20230711-083213.yaml | 7 +++++++ core/dbt/contracts/graph/unparsed.py | 1 - core/dbt/parser/schema_yaml_readers.py | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changes/unreleased/Fixes-20230711-083213.yaml diff --git a/.changes/unreleased/Fixes-20230711-083213.yaml b/.changes/unreleased/Fixes-20230711-083213.yaml new file mode 100644 index 00000000000..e233278e94d --- /dev/null +++ b/.changes/unreleased/Fixes-20230711-083213.yaml @@ -0,0 +1,7 @@ +kind: Fixes +body: Remove `create_metric` as a `SemanticModel.Measure` property because it currently + doesn't do anything +time: 2023-07-11T08:32:13.158779-07:00 +custom: + Author: QMalcolm + Issue: "8064" diff --git a/core/dbt/contracts/graph/unparsed.py b/core/dbt/contracts/graph/unparsed.py index 4c9ec0af104..6c0f79e3499 100644 --- a/core/dbt/contracts/graph/unparsed.py +++ b/core/dbt/contracts/graph/unparsed.py @@ -697,7 +697,6 @@ class UnparsedMeasure(dbtClassMixin): name: str agg: str # actually an enum description: Optional[str] = None - create_metric: bool = False expr: Optional[Union[str, bool, int]] = None agg_params: Optional[MeasureAggregationParameters] = None non_additive_dimension: Optional[UnparsedNonAdditiveDimension] = None diff --git a/core/dbt/parser/schema_yaml_readers.py b/core/dbt/parser/schema_yaml_readers.py index e5e643b31f3..78d62c45c52 100644 --- a/core/dbt/parser/schema_yaml_readers.py +++ b/core/dbt/parser/schema_yaml_readers.py @@ -499,7 +499,6 @@ def _get_measures(self, unparsed_measures: List[UnparsedMeasure]) -> List[Measur name=unparsed.name, agg=AggregationType(unparsed.agg), description=unparsed.description, - create_metric=unparsed.create_metric, expr=str(unparsed.expr) if unparsed.expr is not None else None, agg_params=unparsed.agg_params, non_additive_dimension=self._get_non_additive_dimension(