diff --git a/tests/functional/saved_queries/fixtures.py b/tests/functional/saved_queries/fixtures.py index 77735c9d1a9..96383ab5472 100644 --- a/tests/functional/saved_queries/fixtures.py +++ b/tests/functional/saved_queries/fixtures.py @@ -11,10 +11,10 @@ metrics: - simple_metric group_by: - - "Dimension('user__ds')" + - "Dimension('id__ds')" where: - - "{{ Dimension('user__ds', 'DAY') }} <= now()" - - "{{ Dimension('user__ds', 'DAY') }} >= '2023-01-01'" + - "{{ TimeDimension('id__ds', 'DAY') }} <= now()" + - "{{ TimeDimension('id__ds', 'DAY') }} >= '2023-01-01'" - "{{ Metric('txn_revenue', ['id']) }} > 1" exports: - name: my_export @@ -33,10 +33,10 @@ metrics: - simple_metric group_by: - - "Dimension('user__ds')" + - "Dimension('id__ds')" where: - - "{{ Dimension('user__ds', 'DAY') }} <= now()" - - "{{ Dimension('user__ds', 'DAY') }} >= '2023-01-01'" + - "{{ TimeDimension('id__ds', 'DAY') }} <= now()" + - "{{ TimeDimension('id__ds', 'DAY') }} >= '2023-01-01'" - "{{ Metric('txn_revenue', ['id']) }} > 1" exports: - name: my_export @@ -54,10 +54,10 @@ metrics: - simple_metric group_by: - - "Dimension('user__ds')" + - "Dimension('id__ds')" where: - - "{{ Dimension('user__ds', 'DAY') }} <= now()" - - "{{ Dimension('user__ds', 'DAY') }} >= '2023-01-01'" + - "{{ TimeDimension('id__ds', 'DAY') }} <= now()" + - "{{ TimeDimension('id__ds', 'DAY') }} >= '2023-01-01'" exports: - name: my_export config: @@ -72,8 +72,8 @@ metrics: - simple_metric group_by: - - "Dimension('user__ds')" - where: "{{ Dimension('user__ds', 'DAY') }} <= now()" + - "Dimension('id__ds')" + where: "{{ TimeDimension('id__ds', 'DAY') }} <= now()" """ saved_query_with_extra_config_attributes_yml = """ @@ -85,10 +85,10 @@ metrics: - simple_metric group_by: - - "Dimension('user__ds')" + - "Dimension('id__ds')" where: - - "{{ Dimension('user__ds', 'DAY') }} <= now()" - - "{{ Dimension('user__ds', 'DAY') }} >= '2023-01-01'" + - "{{ TimeDimension('id__ds', 'DAY') }} <= now()" + - "{{ TimeDimension('id__ds', 'DAY') }} >= '2023-01-01'" exports: - name: my_export config: @@ -108,10 +108,10 @@ metrics: - simple_metric group_by: - - "Dimension('user__ds')" + - "Dimension('id__ds')" where: - - "{{ Dimension('user__ds', 'DAY') }} <= now()" - - "{{ Dimension('user__ds', 'DAY') }} >= '2023-01-01'" + - "{{ TimeDimension('id__ds', 'DAY') }} <= now()" + - "{{ TimeDimension('id__ds', 'DAY') }} >= '2023-01-01'" exports: - name: my_export config: @@ -129,10 +129,10 @@ metrics: - simple_metric group_by: - - "Dimension('user__ds')" + - "Dimension('id__ds')" where: - - "{{ Dimension('user__ds', 'DAY') }} <= now()" - - "{{ Dimension('user__ds', 'DAY') }} >= '2023-01-01'" + - "{{ TimeDimension('id__ds', 'DAY') }} <= now()" + - "{{ TimeDimension('id__ds', 'DAY') }} >= '2023-01-01'" exports: - name: my_export """ @@ -149,10 +149,10 @@ metrics: - simple_metric group_by: - - "Dimension('user__ds')" + - "Dimension('id__ds')" where: - - "{{ Dimension('user__ds', 'DAY') }} <= now()" - - "{{ Dimension('user__ds', 'DAY') }} >= '2023-01-01'" + - "{{ TimeDimension('id__ds', 'DAY') }} <= now()" + - "{{ TimeDimension('id__ds', 'DAY') }} >= '2023-01-01'" exports: - name: my_export config: diff --git a/tests/functional/saved_queries/test_saved_query_build.py b/tests/functional/saved_queries/test_saved_query_build.py index dc89521f380..e9c2bbda3f8 100644 --- a/tests/functional/saved_queries/test_saved_query_build.py +++ b/tests/functional/saved_queries/test_saved_query_build.py @@ -12,7 +12,7 @@ ) -class TestSavedQueryBuildNoOp: +class TestSavedQueryBuild: @pytest.fixture(scope="class") def models(self): return { @@ -31,7 +31,8 @@ def packages(self): version: 1.1.1 """ - def test_build_saved_queries(self, project): + def test_build_saved_queries_no_op(self, project) -> None: + """Test building saved query exports with no flag, so should be no-op.""" run_dbt(["deps"]) result = run_dbt(["build"]) assert len(result.results) == 3 diff --git a/tests/functional/saved_queries/test_saved_query_parsing.py b/tests/functional/saved_queries/test_saved_query_parsing.py index be171718a7c..40e4cdfa4fb 100644 --- a/tests/functional/saved_queries/test_saved_query_parsing.py +++ b/tests/functional/saved_queries/test_saved_query_parsing.py @@ -222,14 +222,14 @@ def test_saved_query_filter_types(self, project): where_filter.where_sql_template for where_filter in saved_query1.query_params.where.where_filters } == { - "{{ Dimension('user__ds', 'DAY') }} <= now()", - "{{ Dimension('user__ds', 'DAY') }} >= '2023-01-01'", + "{{ TimeDimension('id__ds', 'DAY') }} <= now()", + "{{ TimeDimension('id__ds', 'DAY') }} >= '2023-01-01'", } # String filter assert len(saved_query2.query_params.where.where_filters) == 1 assert ( saved_query2.query_params.where.where_filters[0].where_sql_template - == "{{ Dimension('user__ds', 'DAY') }} <= now()" + == "{{ TimeDimension('id__ds', 'DAY') }} <= now()" ) def test_saved_query_metrics_changed(self, project):