Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamDee committed Oct 7, 2024
1 parent 89f25ad commit 5944a67
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def parse_and_validate_saved_query(
metrics=None,
group_by_names=saved_query.query_params.group_by,
group_by=None,
where_constraints=PydanticWhereFilterIntersection(where_filters=parsed_where_filters),
where_constraints=parsed_where_filters,
where_constraint_strs=None,
time_constraint_start=time_constraint_start,
time_constraint_end=time_constraint_end,
Expand Down
5 changes: 4 additions & 1 deletion metricflow/engine/metricflow_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,10 @@ def _create_execution_plan(self, mf_query_request: MetricFlowQueryRequest) -> Me
raise InvalidQueryException("Group by items can't be specified with a saved query.")
query_spec = self._query_parser.parse_and_validate_saved_query(
saved_query_parameter=SavedQueryParameter(mf_query_request.saved_query_name),
where_filters=[PydanticWhereFilter(where_sql_template=mf_query_request.where_constraints)]
where_filters=[
PydanticWhereFilter(where_sql_template=where_constraint)
for where_constraint in mf_query_request.where_constraints
]
if mf_query_request.where_constraints is not None
else None,
limit=mf_query_request.limit,
Expand Down
2 changes: 0 additions & 2 deletions tests_metricflow/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def test_saved_query( # noqa: D103
resp = cli_runner.run(
query, args=["--saved-query", "p0_booking", "--order", "metric_time__day,listing__capacity_latest"]
)
print(resp.output)

assert resp.exit_code == 0

Expand Down Expand Up @@ -294,5 +293,4 @@ def test_saved_query_with_cumulative_metric( # noqa: D103
snapshot_str=resp.output,
sql_engine=sql_client.sql_engine_type,
)
print(resp.output)
assert resp.exit_code == 0

0 comments on commit 5944a67

Please sign in to comment.