Skip to content

Commit

Permalink
Surface underlying error message in where parameter (#798)
Browse files Browse the repository at this point in the history
This surfaces the underlying error message from the where clause. This is helpful in situations like this https://dbt-labs.slack.com/archives/C03KHQRQUBX/p1696602586211399
  • Loading branch information
DevonFulcher authored Oct 6, 2023
1 parent dbbff3e commit 404c89f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20231006-095540.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Expose underlying where clause error message
time: 2023-10-06T09:55:40.737735-05:00
custom:
Author: DevonFulcher
Issue: None
4 changes: 3 additions & 1 deletion metricflow/query/query_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,9 @@ def _parse_and_validate_query(
column_association_resolver=self._column_association_resolver,
).create_from_where_filter(where_filter)
except ParseWhereFilterException as e:
raise InvalidQueryException(f"Error parsing the where filter: {where_filter.where_sql_template}") from e
raise InvalidQueryException(
f"Error parsing the where filter: {where_filter.where_sql_template}. {e}"
) from e

where_spec_set = QueryTimeLinkableSpecSet.create_from_linkable_spec_set(where_filter_spec.linkable_spec_set)
requested_linkable_specs_with_requested_filter_specs = QueryTimeLinkableSpecSet.combine(
Expand Down

0 comments on commit 404c89f

Please sign in to comment.