class_docstr: Builds a GroupByItemResolutionDag that can be used to resolve group-by-item specs from spec patterns.
class_docstr_tok: ["Builds","a","GroupByItemResolutionDag","that","can","be","used","to","resolve","group-by-item","specs","from","spec","patterns","."]
docstr: Builds a DAG component that represents the resolution flow for a query.
docstr_tok: ["Builds","a","DAG","component","that","represents","the","resolution","flow","for","a","query","."]
code: def _build_dag_component_for_query(
      self,
      metric_references: Sequence[MetricReference],
      where_filter_intersection: WhereFilterIntersection,
  ) -> QueryGroupByItemResolutionNode:
      """Builds a DAG component that represents the resolution flow for a query."""
      if len(metric_references) == 0:
          return QueryGroupByItemResolutionNode(
              parent_nodes=(NoMetricsGroupByItemSourceNode(),),
              metrics_in_query=metric_references,
              where_filter_intersection=where_filter_intersection,
          )
      return QueryGroupByItemResolutionNode(
          parent_nodes=tuple(
              self._build_dag_component_for_metric(
                  metric_reference=metric_reference,
                  metric_input_location=None,
              )
              for metric_reference in metric_references
          ),
          metrics_in_query=metric_references,
          where_filter_intersection=where_filter_intersection,
      )
  
file_path: metricflow/metricflow/query/group_by_item/resolution_dag/dag_builder.py
imports: from __future__ import annotations
  import logging
  from typing import Optional, Sequence, Tuple
  from dbt_semantic_interfaces.implementations.filters.where_filter import PydanticWhereFilterIntersection
  from dbt_semantic_interfaces.protocols import WhereFilterIntersection
  from dbt_semantic_interfaces.references import MeasureReference, MetricReference
  from dbt_semantic_interfaces.type_enums import MetricType
  from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
  from metricflow.query.group_by_item.resolution_dag.dag import GroupByItemResolutionDag
  from metricflow.query.group_by_item.resolution_dag.input_metric_location import InputMetricDefinitionLocation
  from metricflow.query.group_by_item.resolution_dag.resolution_nodes.measure_source_node import MeasureGroupByItemSourceNode
  from metricflow.query.group_by_item.resolution_dag.resolution_nodes.metric_resolution_node import MetricGroupByItemResolutionNode
  from metricflow.query.group_by_item.resolution_dag.resolution_nodes.no_metrics_query_source_node import NoMetricsGroupByItemSourceNode
  from metricflow.query.group_by_item.resolution_dag.resolution_nodes.query_resolution_node import QueryGroupByItemResolutionNode
label_desc: Use image node_id 3 for calling the GroupByItemResolutionDagBuilder obj's underlying member method code with example usage: obj._build_dag_component_for_query(metric_references, where_filter_intersection) and returns: QueryGroupByItemResolutionNode, QueryGroupByItemResolutionNode