Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Correct metricflow_time_spine_sql in test fixtures
  • Loading branch information
QMalcolm committed Jul 11, 2023
commit 63a7acaa0619641e3ac235b8027e30086fb2e14a
2 changes: 1 addition & 1 deletion tests/functional/exposures/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


metricflow_time_spine_sql = """
SELECT to_date('02/20/2023, 'mm/dd/yyyy') as date_day
SELECT to_date('02/20/2023', 'mm/dd/yyyy') as date_day
"""


Expand Down
2 changes: 1 addition & 1 deletion tests/functional/partial_parsing/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
"""

metricflow_time_spine_sql = """
SELECT to_date('02/20/2023, 'mm/dd/yyyy') as date_day
SELECT to_date('02/20/2023', 'mm/dd/yyyy') as date_day
"""

env_var_schema3_yml = """
Expand Down
23 changes: 13 additions & 10 deletions tests/functional/partial_parsing/test_pp_disabled_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
select 1 as fun
"""

metricflow_time_spine_sql = """
SELECT to_date('02/20/2023', 'mm/dd/yyyy') as date_day
"""

schema1_yml = """
version: 2

Expand All @@ -13,7 +17,7 @@

semantic_models:
- name: semantic_people
model: ref('people')
model: ref('model_one')
dimensions:
- name: created_at
type: TIME
Expand Down Expand Up @@ -59,7 +63,7 @@

semantic_models:
- name: semantic_people
model: ref('people')
model: ref('model_one')
dimensions:
- name: created_at
type: TIME
Expand Down Expand Up @@ -109,7 +113,7 @@

semantic_models:
- name: semantic_people
model: ref('people')
model: ref('model_one')
dimensions:
- name: created_at
type: TIME
Expand Down Expand Up @@ -162,6 +166,7 @@ class TestDisabled:
def models(self):
return {
"model_one.sql": model_one_sql,
"metricflow_time_spine.sql": metricflow_time_spine_sql,
"schema.yml": schema1_yml,
}

Expand All @@ -170,10 +175,8 @@ def test_pp_disabled(self, project):
expected_metric = "metric.test.number_of_people"

run_dbt(["seed"])
results = run_dbt(["run"])
assert len(results) == 1
manifest = run_dbt(["parse"])

manifest = get_manifest(project.project_root)
assert expected_exposure in manifest.exposures
assert expected_metric in manifest.metrics
assert expected_exposure not in manifest.disabled
Expand All @@ -182,7 +185,7 @@ def test_pp_disabled(self, project):
# Update schema file with disabled metric and exposure
write_file(schema2_yml, project.project_root, "models", "schema.yml")
results = run_dbt(["--partial-parse", "run"])
assert len(results) == 1
assert len(results) == 2
manifest = get_manifest(project.project_root)
assert expected_exposure not in manifest.exposures
assert expected_metric not in manifest.metrics
Expand All @@ -192,7 +195,7 @@ def test_pp_disabled(self, project):
# Update schema file with enabled metric and exposure
write_file(schema1_yml, project.project_root, "models", "schema.yml")
results = run_dbt(["--partial-parse", "run"])
assert len(results) == 1
assert len(results) == 2
manifest = get_manifest(project.project_root)
assert expected_exposure in manifest.exposures
assert expected_metric in manifest.metrics
Expand All @@ -202,7 +205,7 @@ def test_pp_disabled(self, project):
# Update schema file - remove exposure, enable metric
write_file(schema3_yml, project.project_root, "models", "schema.yml")
results = run_dbt(["--partial-parse", "run"])
assert len(results) == 1
assert len(results) == 2
manifest = get_manifest(project.project_root)
assert expected_exposure not in manifest.exposures
assert expected_metric in manifest.metrics
Expand All @@ -212,7 +215,7 @@ def test_pp_disabled(self, project):
# Update schema file - add back exposure, remove metric
write_file(schema4_yml, project.project_root, "models", "schema.yml")
results = run_dbt(["--partial-parse", "run"])
assert len(results) == 1
assert len(results) == 2
manifest = get_manifest(project.project_root)
assert expected_exposure not in manifest.exposures
assert expected_metric not in manifest.metrics
Expand Down