From dd2b0f1c3b7065a51994c9e7fd69f1e92fa8fbc3 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Mon, 6 Nov 2023 08:59:11 -0800 Subject: [PATCH 1/3] Update dependencies to `dbt-semantic-interfaces~=0.4.0`. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 92e5beb583..74c3e78b9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dependencies = [ "PyYAML~=6.0", "click>=7.1.2", "dbt-core~=1.7.0rc1", - "dbt-semantic-interfaces~=0.3.0", + "dbt-semantic-interfaces~=0.4.0", "graphviz>=0.18.2, <0.21", "halo~=0.0.31", "more-itertools>=8.10.0, <10.2.0", From 4b94b5b5eb1fc912e7bf7932e19246f722c75315 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Mon, 6 Nov 2023 08:59:46 -0800 Subject: [PATCH 2/3] Changes as required by `dbt-semantic-interfaces~=0.4.0`. --- metricflow/query/query_parser.py | 9 +++++---- .../simple_manifest/saved_queries.yaml | 17 +++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/metricflow/query/query_parser.py b/metricflow/query/query_parser.py index cad5e9f0e1..f302a48365 100644 --- a/metricflow/query/query_parser.py +++ b/metricflow/query/query_parser.py @@ -199,15 +199,16 @@ def parse_and_validate_saved_query( # Merge interface could streamline this. where_filters: List[WhereFilter] = [] - if saved_query.where is not None: - where_filters.extend(saved_query.where.where_filters) + if saved_query.query_params.where is not None: + where_filters.extend(saved_query.query_params.where.where_filters) if where_filter is not None: where_filters.append(where_filter) return self.parse_and_validate_query( - metrics=tuple(MetricParameter(name=metric_name) for metric_name in saved_query.metrics), + metrics=tuple(MetricParameter(name=metric_name) for metric_name in saved_query.query_params.metrics), group_by=tuple( - parse_object_builder_naming_scheme(group_by_item_name) for group_by_item_name in saved_query.group_bys + parse_object_builder_naming_scheme(group_by_item_name) + for group_by_item_name in saved_query.query_params.group_by ), where_constraint=merge_to_single_where_filter(PydanticWhereFilterIntersection(where_filters=where_filters)), limit=limit, diff --git a/metricflow/test/fixtures/semantic_manifest_yamls/simple_manifest/saved_queries.yaml b/metricflow/test/fixtures/semantic_manifest_yamls/simple_manifest/saved_queries.yaml index 0149eacd23..f8c33f1b89 100644 --- a/metricflow/test/fixtures/semantic_manifest_yamls/simple_manifest/saved_queries.yaml +++ b/metricflow/test/fixtures/semantic_manifest_yamls/simple_manifest/saved_queries.yaml @@ -2,11 +2,12 @@ saved_query: name: p0_booking description: Booking-related metrics that are of the highest priority. - metrics: - - bookings - - instant_bookings - group_bys: - - TimeDimension('metric_time', 'day') - - Dimension('listing__capacity_latest') - where: - - "{{ Dimension('listing__capacity_latest') }} > 3" + query_params: + metrics: + - bookings + - instant_bookings + group_by: + - TimeDimension('metric_time', 'day') + - Dimension('listing__capacity_latest') + where: + - "{{ Dimension('listing__capacity_latest') }} > 3" From 210670eeb0b1ed331c250fa2dd7898d1160a96c4 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Mon, 6 Nov 2023 09:04:13 -0800 Subject: [PATCH 3/3] Add change log for #846. --- .changes/unreleased/Breaking Changes-20231106-090301.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Breaking Changes-20231106-090301.yaml diff --git a/.changes/unreleased/Breaking Changes-20231106-090301.yaml b/.changes/unreleased/Breaking Changes-20231106-090301.yaml new file mode 100644 index 0000000000..d4d05c3cca --- /dev/null +++ b/.changes/unreleased/Breaking Changes-20231106-090301.yaml @@ -0,0 +1,6 @@ +kind: Breaking Changes +body: Update Dependencies to Use `dbt-semantic-interfaces~=0.4.0` +time: 2023-11-06T09:03:01.474125-08:00 +custom: + Author: plypaul + Issue: "846"