-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a no-op runner for saved_query (#8937)
(cherry picked from commit 211392c)
- Loading branch information
1 parent
b6f0eac
commit b6b452f
Showing
10 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Under the Hood | ||
body: Add a no-op runner for Saved Qeury | ||
time: 2023-10-27T14:00:48.4755-07:00 | ||
custom: | ||
Author: ChenyuLInx | ||
Issue: "8893" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import pytest | ||
|
||
from dbt.tests.util import run_dbt | ||
from tests.functional.saved_queries.fixtures import saved_queries_yml, saved_query_description | ||
from tests.functional.semantic_models.fixtures import ( | ||
fct_revenue_sql, | ||
metricflow_time_spine_sql, | ||
schema_yml, | ||
) | ||
|
||
|
||
class TestSavedQueryBuildNoOp: | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return { | ||
"saved_queries.yml": saved_queries_yml, | ||
"schema.yml": schema_yml, | ||
"fct_revenue.sql": fct_revenue_sql, | ||
"metricflow_time_spine.sql": metricflow_time_spine_sql, | ||
"docs.md": saved_query_description, | ||
} | ||
|
||
@pytest.fixture(scope="class") | ||
def packages(self): | ||
return """ | ||
packages: | ||
- package: dbt-labs/dbt_utils | ||
version: 1.1.1 | ||
""" | ||
|
||
def test_semantic_model_parsing(self, project): | ||
run_dbt(["deps"]) | ||
result = run_dbt(["build"]) | ||
assert len(result.results) == 2 | ||
assert "test_saved_query" not in [r.node.name for r in result.results] | ||
result = run_dbt(["build", "--include-saved-query"]) | ||
assert len(result.results) == 3 | ||
assert "test_saved_query" in [r.node.name for r in result.results] |