From 1c8a21ec3d607458766fc01c73be9e4ab5d67317 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 18 Sep 2023 11:57:10 -0700 Subject: [PATCH] More generic error message for granularity issues --- metricflow/query/query_parser.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/metricflow/query/query_parser.py b/metricflow/query/query_parser.py index 9d1390936a..b2c6aa4166 100644 --- a/metricflow/query/query_parser.py +++ b/metricflow/query/query_parser.py @@ -680,9 +680,7 @@ def _parse_linkable_elements( for linkable_element in linkable_elements: parsed_name = StructuredLinkableSpecName.from_name(linkable_element.name) if parsed_name.time_granularity: - raise ValueError( - "Time granularity must be passed in the `grain` attribute for `group_by` query param." - ) + raise ValueError("Must use object syntax for `grain` parameter if `date_part` is requested.") structured_name = StructuredLinkableSpecName( entity_link_names=parsed_name.entity_link_names, element_name=parsed_name.element_name,