From 6447a05c1db5cdefe8532cc1f34fcc6a72cbbc9b Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 8 Jul 2024 17:07:39 -0700 Subject: [PATCH] Remove inconsistent validation for `TimeDimensionParameter` (#1314) Two things: - This error wasn't do what it was supposed to do, since it never checked if `date_part` was passed. I don't think this ever got triggered because MFS was parsing the grain from the `name` param and passing it via the `grain` param instead. - I ran into this error in the process of trying to create consistency in the behavior of our Jinja params. Since most interfaces allow passing grain via dundered syntax, this interface is inconsistent. If we eventually want to retire the dunder syntax, we should deprecate it everywhere at once to avoid creating confusion for our users in the meantime. --- .../specs/query_param_implementations.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/metricflow-semantics/metricflow_semantics/specs/query_param_implementations.py b/metricflow-semantics/metricflow_semantics/specs/query_param_implementations.py index 697b65db8f..d13b2bcd05 100644 --- a/metricflow-semantics/metricflow_semantics/specs/query_param_implementations.py +++ b/metricflow-semantics/metricflow_semantics/specs/query_param_implementations.py @@ -41,11 +41,6 @@ def _implements_protocol(self) -> TimeDimensionQueryParameter: grain: Optional[TimeGranularity] = None date_part: Optional[DatePart] = None - def __post_init__(self) -> None: # noqa: D105 - parsed_name = StructuredLinkableSpecName.from_name(self.name) - if parsed_name.time_granularity: - raise ValueError("Must use object syntax for `grain` parameter if `date_part` is requested.") - @property def query_resolver_input(self) -> ResolverInputForGroupByItem: # noqa: D102 fields_to_compare = [