Skip to content

Commit

Permalink
Update semantic model parsing test to check create_metric = true fu…
Browse files Browse the repository at this point in the history
…nctionality
  • Loading branch information
QMalcolm committed Aug 3, 2023
1 parent a433c31 commit cca58f7
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions tests/functional/semantic_models/test_semantic_model_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
expr: revenue
agg: sum
agg_time_dimension: ds
create_metric: true
- name: sum_of_things
expr: 2
agg: sum
Expand Down Expand Up @@ -63,14 +64,6 @@
expr: user_id
- name: id
type: primary
metrics:
- name: records_with_revenue
label: "Number of records with revenue"
description: Total number of records with revenue
type: simple
type_params:
measure: has_revenue
"""

schema_without_semantic_model_yml = """models:
Expand Down Expand Up @@ -126,6 +119,10 @@ def test_semantic_model_parsing(self, project):
== f'"dbt"."{project.test_schema}"."fct_revenue"'
)
assert len(semantic_model.measures) == 5
# manifest should have one metric (that was created from a measure)
assert len(manifest.metrics) == 1
metric = manifest.metrics["metric.test.txn_revenue"]
assert metric.name == "txn_revenue"

def test_semantic_model_error(self, project):
# Next, modify the default schema.yml to remove the semantic model.
Expand Down

0 comments on commit cca58f7

Please sign in to comment.