class_docstr: MetricFlow Python client for running basic queries and other standard commands.
docstr: Makes a query for a metric.
  
  Args:
      metrics: Names of the metrics to query.
      dimensions: Names of the dimensions and entities to query.
      limit: Limit the result to this many rows.
      start_time: Get data for the start of this time range.
      end_time: Get data for the end of this time range.
      where: A SQL string using group by names that can be used like a where clause on the output data.
      order: metric and group by names to order by. A "-" can be used to specify reverse order e.g. "-ds"
      as_table: If specified, output the result data to this table instead of a result dataframe.
      sql_optimization_level: The level of optimization for the generated SQL. Pass integer from 0-4.
  
  Returns:
      MetricFlowQueryResult that contains the result and context of the query.
docstr_tok: ["Makes","a","query","for","a","metric",".","Args",":","metrics",":","Names","of","the","metrics","to","query",".","dimensions",":","Names","of","the","dimensions","and","entities","to","query",".","limit",":","Limit","the","result","to","this","many","rows",".","start_time",":","Get","data","for","the","start","of","this","time","range",".","end_time",":","Get","data","for","the","end","of","this","time","range",".","where",":","A","SQL","string","using","group","by","names","that","can","be","used","like","a","where","clause","on","the","output","data",".","order",":","metric","and","group","by","names","to","order","by",".","A","``","-","''","can","be","used","to","specify","reverse","order","e.g",".","``","-ds","''","as_table",":","If","specified",",","output","the","result","data","to","this","table","instead","of","a","result","dataframe",".","sql_optimization_level",":","The","level","of","optimization","for","the","generated","SQL",".","Pass","integer","from","0-4",".","Returns",":","MetricFlowQueryResult","that","contains","the","result","and","context","of","the","query","."]
code: def query(
      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,
  ) -> MetricFlowQueryResult:
      """Makes a query for a metric.
  
      Args:
          metrics: Names of the metrics to query.
          dimensions: Names of the dimensions and entities to query.
          limit: Limit the result to this many rows.
          start_time: Get data for the start of this time range.
          end_time: Get data for the end of this time range.
          where: A SQL string using group by names that can be used like a where clause on the output data.
          order: metric and group by names to order by. A "-" can be used to specify reverse order e.g. "-ds"
          as_table: If specified, output the result data to this table instead of a result dataframe.
          sql_optimization_level: The level of optimization for the generated SQL. Pass integer from 0-4.
  
      Returns:
          MetricFlowQueryResult that contains the result and context of the query.
      """
      mf_request = self._create_mf_request(
          metrics=metrics,
          dimensions=dimensions,
          limit=limit,
          start_time=start_time,
          end_time=end_time,
          where=where,
          order=order,
          as_table=as_table,
          sql_optimization_level=sql_optimization_level,
      )
      return self.engine.query(mf_request=mf_request)
  
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 3 for calling the MetricFlowClient obj's underlying member method code with example usage: obj.query(metrics, dimensions, limit, start_time, end_time, where, order, as_table, sql_optimization_level) and returns: self