class_docstr: Dataclass representation of a Dimension.
class_docstr_tok: ["Dataclass","representation","of","a","Dimension","."]
docstr: Build from pydantic Dimension and entity_key.
docstr_tok: ["Build","from","pydantic","Dimension","and","entity_key","."]
code: def from_pydantic(
      cls,
      pydantic_dimension: SemanticManifestDimension,
      path_key: ElementPathKey,
  ) -> Dimension:
      """Build from pydantic Dimension and entity_key."""
      qualified_name = DimensionSpec(
          element_name=path_key.element_name,
          entity_links=path_key.entity_links,
      ).qualified_name
      parsed_type_params: Optional[DimensionTypeParams] = None
      if pydantic_dimension.type_params:
          parsed_type_params = PydanticDimensionTypeParams(
              time_granularity=path_key.time_granularity,
              validity_params=pydantic_dimension.type_params.validity_params,
          )
      return cls(
          name=pydantic_dimension.name,
          qualified_name=qualified_name,
          description=pydantic_dimension.description,
          type=pydantic_dimension.type,
          type_params=parsed_type_params,
          metadata=pydantic_dimension.metadata,
          is_partition=pydantic_dimension.is_partition,
          expr=pydantic_dimension.expr,
          label=pydantic_dimension.label,
      )
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import List, Optional, Sequence
  from dbt_semantic_interfaces.implementations.elements.dimension import PydanticDimensionTypeParams
  from dbt_semantic_interfaces.protocols.dimension import Dimension
  from dbt_semantic_interfaces.protocols.dimension import DimensionType, DimensionTypeParams
  from dbt_semantic_interfaces.protocols.entity import Entity
  from dbt_semantic_interfaces.protocols.measure import MeasureAggregationParameters
  from dbt_semantic_interfaces.protocols.metadata import Metadata
  from dbt_semantic_interfaces.protocols.metric import Metric
  from dbt_semantic_interfaces.protocols.metric import MetricInputMeasure, MetricType, MetricTypeParams
  from dbt_semantic_interfaces.protocols.saved_query import SavedQuery
  from dbt_semantic_interfaces.protocols.saved_query import SavedQueryQueryParams
  from dbt_semantic_interfaces.protocols.where_filter import WhereFilterIntersection
  from dbt_semantic_interfaces.transformations.add_input_metric_measures import AddInputMetricMeasuresRule
  from dbt_semantic_interfaces.type_enums.aggregation_type import AggregationType
  from dbt_semantic_interfaces.type_enums.entity_type import EntityType
  from metricflow.model.semantics.linkable_spec_resolver import ElementPathKey
  from metricflow.naming.linkable_spec_name import StructuredLinkableSpecName
  from metricflow.specs.specs import DimensionSpec
label_desc: Use image node_id 1 for calling the Dimension obj's underlying member method code with example usage: obj.from_pydantic(cls, pydantic_dimension, path_key) and returns: cls