class_docstr: Time dimension requested in a query.
class_docstr_tok: ["Time","dimension","requested","in","a","query","."]
code: def __post_init__(self) -> None:  # noqa: D
      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."
          )
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import Optional
  from dbt_semantic_interfaces.protocols import ProtocolHint
  from dbt_semantic_interfaces.references import EntityReference
  from dbt_semantic_interfaces.type_enums.date_part import DatePart
  from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
  from typing_extensions import override
  from metricflow.naming.linkable_spec_name import StructuredLinkableSpecName
  from metricflow.naming.metric_scheme import MetricNamingScheme
  from metricflow.naming.object_builder_scheme import ObjectBuilderNamingScheme
  from metricflow.protocols.query_parameter import DimensionOrEntityQueryParameter, InputOrderByParameter, TimeDimensionQueryParameter
  from metricflow.protocols.query_parameter import SavedQueryParameter
  from metricflow.query.resolver_inputs.query_resolver_inputs import ResolverInputForGroupByItem, ResolverInputForMetric, ResolverInputForOrderByItem
  from metricflow.specs.patterns.entity_link_pattern import EntityLinkPattern, EntityLinkPatternParameterSet, ParameterSetField
label_desc: Use image node_id 2 for calling the TimeDimensionParameter obj's underlying member method code with example usage: obj.__post_init__() without return types