From d8d58a00671bebb5b3a16ee7f968693523aa4580 Mon Sep 17 00:00:00 2001 From: Devon Fulcher Date: Fri, 6 Oct 2023 09:56:14 -0500 Subject: [PATCH] surfacing underlying error message in where clause --- .changes/unreleased/Under the Hood-20231006-095540.yaml | 6 ++++++ metricflow/query/query_parser.py | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Under the Hood-20231006-095540.yaml diff --git a/.changes/unreleased/Under the Hood-20231006-095540.yaml b/.changes/unreleased/Under the Hood-20231006-095540.yaml new file mode 100644 index 0000000000..8630b267ce --- /dev/null +++ b/.changes/unreleased/Under the Hood-20231006-095540.yaml @@ -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 diff --git a/metricflow/query/query_parser.py b/metricflow/query/query_parser.py index e2e0edbece..aa3acd4f15 100644 --- a/metricflow/query/query_parser.py +++ b/metricflow/query/query_parser.py @@ -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(