Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dependencies to Use dbt-semantic-interfaces~=0.4.0 #847

Merged
merged 3 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .changes/unreleased/Breaking Changes-20231106-090301.yaml
Original file line number Diff line number Diff line change
@@ -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"
9 changes: 5 additions & 4 deletions metricflow/query/query_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down