code: def test_derived_metric_query_parsing() -> None:
      """Test derived metric inputs are properly validated."""
      bookings_yaml_file = YamlConfigFile(
          filepath="inline_for_test_1", contents=BOOKINGS_YAML
      )
      metrics_yaml_file = YamlConfigFile(
          filepath="inline_for_test_1", contents=METRICS_YAML
      )
      revenue_yaml_file = YamlConfigFile(
          filepath="inline_for_test_1", contents=REVENUE_YAML
      )
      query_parser = query_parser_from_yaml(
          [
              EXAMPLE_PROJECT_CONFIGURATION_YAML_CONFIG_FILE,
              bookings_yaml_file,
              revenue_yaml_file,
              metrics_yaml_file,
          ]
      )
      # Attempt to query with no dimension
      with pytest.raises(
          InvalidQueryException, match="do not include 'metric_time'"
      ):
          query_parser.parse_and_validate_query(
              metric_names=["revenue_sub_10"],
              group_by_names=[],
          )
  
      # Attempt to query with non-time dimension
      with pytest.raises(
          InvalidQueryException,
          match="does not match any of the available",
      ):
          query_parser.parse_and_validate_query(
              metric_names=["revenue_sub_10"],
              group_by_names=["country"],
          )
  
      # Query with time dimension
      query_parser.parse_and_validate_query(
          metric_names=["revenue_sub_10"],
          group_by_names=[MTD],
      )
  
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 15 for calling a global function with example usage: test_derived_metric_query_parsing() without return types