code: def test_parse_and_validate_metric_constraint_dims() -> None:
      """Test that the returned time constraint in the query spec is adjusted to match the granularity of the query.
  
      TODO: This test doesn't do what it says it does.
      """
      revenue_yaml_file = YamlConfigFile(
          filepath="inline_for_test_2", contents=REVENUE_YAML
      )
      query_parser = query_parser_from_yaml(
          [
              EXAMPLE_PROJECT_CONFIGURATION_YAML_CONFIG_FILE,
              revenue_yaml_file,
          ]
      )
  
      # check constraint on invalid_dim raises InvalidQueryException
      with pytest.raises(
          InvalidQueryException,
          match="given input does not exactly match",
      ):
          query_parser.parse_and_validate_query(
              metric_names=["metric_with_invalid_constraint"],
              group_by_names=[MTD],
              time_constraint_start=as_datetime("2020-01-15"),
              time_constraint_end=as_datetime("2020-02-15"),
          )
  
imports: from __future__ import annotations
  import logging
  import textwrap
  import pytest
  from dbt_semantic_interfaces.parsing.objects import YamlConfigFile
  from dbt_semantic_interfaces.references import EntityReference
  from dbt_semantic_interfaces.test_utils import as_datetime
  from dbt_semantic_interfaces.type_enums.date_part import DatePart
  from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
  from metricflow.filters.time_constraint import TimeRangeConstraint
  from metricflow.query.query_exceptions import InvalidQueryException
  from metricflow.query.query_parser import MetricFlowQueryParser
  from metricflow.specs.query_param_implementations import DimensionOrEntityParameter, MetricParameter, OrderByParameter, TimeDimensionParameter
  from metricflow.specs.specs import DimensionSpec, EntitySpec, MetricSpec, OrderBySpec, TimeDimensionSpec
  from metricflow.test.fixtures.model_fixtures import query_parser_from_yaml
  from metricflow.test.model.example_project_configuration import EXAMPLE_PROJECT_CONFIGURATION_YAML_CONFIG_FILE
  from metricflow.test.time.metric_time_dimension import MTD
label_desc: Use image node_id 11 for calling a global function with example usage: test_parse_and_validate_metric_constraint_dims() without return types