class_docstr: MetricFlow Python client for running basic queries and other standard commands.
docstr: Build MetricFlowQueryRequest given common query parameters.
docstr_tok: ["Build","MetricFlowQueryRequest","given","common","query","parameters","."]
code: def _create_mf_request(
      self,
      metrics: List[str],
      dimensions: List[str] = [],
      limit: Optional[int] = None,
      start_time: Optional[str] = None,
      end_time: Optional[str] = None,
      where: Optional[str] = None,
      order: Optional[List[str]] = None,
      as_table: Optional[str] = None,
      sql_optimization_level: int = 4,
  ) -> MetricFlowQueryRequest:
      """Build MetricFlowQueryRequest given common query parameters."""
      parsed_optimization_level = SqlQueryOptimizationLevel(
          f"O{sql_optimization_level}"
      )
      parsed_start_time = _convert_to_datetime(start_time)
      parsed_end_time = _convert_to_datetime(end_time)
      return MetricFlowQueryRequest.create_with_random_request_id(
          metric_names=metrics,
          group_by_names=dimensions,
          limit=limit,
          time_constraint_start=parsed_start_time,
          time_constraint_end=parsed_end_time,
          where_constraint=where,
          order_by_names=order,
          output_table=as_table,
          sql_optimization_level=parsed_optimization_level,
      )
  
imports: from __future__ import annotations
  import datetime
  import logging
  from typing import Dict, List, Optional
  from dateutil.parser import parse
  from dbt_semantic_interfaces.protocols.semantic_manifest import SemanticManifest
  from dbt_semantic_interfaces.validations.semantic_manifest_validator import SemanticManifestValidator
  from dbt_semantic_interfaces.validations.validator_helpers import SemanticManifestValidationResults
  from metricflow.engine.metricflow_engine import MetricFlowEngine, MetricFlowExplainResult, MetricFlowQueryRequest, MetricFlowQueryResult
  from metricflow.engine.models import Dimension, Metric
  from metricflow.model.semantic_manifest_lookup import SemanticManifestLookup
  from metricflow.protocols.sql_client import SqlClient
  from metricflow.sql.optimizer.optimization_levels import SqlQueryOptimizationLevel
label_desc: Use image node_id 2 for calling the MetricFlowClient obj's underlying member method code with example usage: obj._create_mf_request(metrics, dimensions, limit, start_time, end_time, where, order, as_table, sql_optimization_level) and returns: MetricFlowQueryRequest