code: def test_query(
      mf_client: MetricFlowClient,
      mf_test_session_state: MetricFlowTestSessionState,
  ) -> None:  # noqa: D
      result = mf_client.query(
          ["bookings"],
          ["metric_time"],
          limit=2,
          start_time="2019-01-01",
          end_time="2024-01-01",
      )
      assert result.query_spec
      assert result.dataflow_plan
      assert result.sql
      assert result.result_df is not None
      assert len(result.result_df) == 2
      assert result.result_table is None
  
      output_table = SqlTable(
          schema_name=mf_test_session_state.mf_system_schema,
          table_name=f"test_table_{random_id()}",
      )
      result = mf_client.query(
          ["bookings"],
          ["metric_time"],
          limit=2,
          start_time="2019-01-01",
          end_time="2024-01-01",
          as_table=output_table.sql,
      )
      assert result.query_spec
      assert result.dataflow_plan
      assert result.sql
      assert result.result_df is None
      assert result.result_table == output_table
  
file_path: metricflow/metricflow/test/api/test_metricflow_client.py
imports: from __future__ import annotations
  from dbt_semantic_interfaces.validations.validator_helpers import SemanticManifestValidationResults
  from metricflow.api.metricflow_client import MetricFlowClient
  from metricflow.dataflow.sql_table import SqlTable
  from metricflow.engine.models import Dimension, Metric
  from metricflow.random_id import random_id
  from metricflow.test.fixtures.setup_fixtures import MetricFlowTestSessionState
label_desc: Use image node_id 1 for calling a global function with example usage: test_query(mf_client, mf_test_session_state) without return types