class_docstr: Validates that a query does not include the same metric multiple times.
class_docstr_tok: ["Validates","that","a","query","does","not","include","the","same","metric","multiple","times","."]
code: def validate_query_in_resolution_dag(
      self,
      metrics_in_query: Sequence[MetricReference],
      where_filter_intersection: WhereFilterIntersection,
      resolver_input_for_query: ResolverInputForQuery,
      resolution_path: MetricFlowQueryResolutionPath,
  ) -> MetricFlowQueryResolutionIssueSet:
      duplicate_metric_references = tuple(
          sorted(
              metric_reference
              for metric_reference in set(metrics_in_query)
              if metrics_in_query.count(metric_reference) > 1
          )
      )
  
      if len(duplicate_metric_references) > 0:
          return MetricFlowQueryResolutionIssueSet.from_issue(
              DuplicateMetricIssue.from_parameters(
                  query_resolution_path=resolution_path,
                  duplicate_metric_references=duplicate_metric_references,
              )
          )
  
      return MetricFlowQueryResolutionIssueSet.empty_instance()
  
file_path: metricflow/metricflow/query/validation_rules/duplicate_metric.py
imports: from __future__ import annotations
  import logging
  from typing import Sequence
  from dbt_semantic_interfaces.protocols import WhereFilterIntersection
  from dbt_semantic_interfaces.references import MetricReference
  from typing_extensions import override
  from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
  from metricflow.query.group_by_item.resolution_path import MetricFlowQueryResolutionPath
  from metricflow.query.issues.issues_base import MetricFlowQueryResolutionIssueSet
  from metricflow.query.issues.parsing.duplicate_metric import DuplicateMetricIssue
  from metricflow.query.resolver_inputs.query_resolver_inputs import ResolverInputForQuery
  from metricflow.query.validation_rules.base_validation_rule import PostResolutionQueryValidationRule
label_desc: Use image node_id 3 for calling the DuplicateMetricValidationRule obj's underlying member method code with example usage: obj.validate_query_in_resolution_dag(metrics_in_query, where_filter_intersection, resolver_input_for_query, resolution_path) and returns: MetricFlowQueryResolutionIssueSet, MetricFlowQueryResolutionIssueSet