docstr: Sets the connection to use to evaluate Vega data transformations.
  
  Named tables returned by the connection's `tables` method may be referenced in Vega/Altair
  chart specifications using special dataset URLs. For example, if the connection's `tables`
  method returns a dictionary that includes "tableA" as a key, then this table may be
  referenced in a chart specification using the URL "table://tableA" or
  "vegafusion+dataset://tableA".
  
  :param connection: One of:
    - An instance of vegafusion.connection.SqlConnection
    - An instance of a duckdb connection
    - A string, one of:
          - "datafusion" (default)
          - "duckdb"
code: def set_connection(
      self,
      connection: Union[
          str, SqlConnection, DuckDBPyConnection
      ] = "datafusion",
  ):
      """
      Sets the connection to use to evaluate Vega data transformations.
  
      Named tables returned by the connection's `tables` method may be referenced in Vega/Altair
      chart specifications using special dataset URLs. For example, if the connection's `tables`
      method returns a dictionary that includes "tableA" as a key, then this table may be
      referenced in a chart specification using the URL "table://tableA" or
      "vegafusion+dataset://tableA".
  
      :param connection: One of:
        - An instance of vegafusion.connection.SqlConnection
        - An instance of a duckdb connection
        - A string, one of:
              - "datafusion" (default)
              - "duckdb"
      """
      if isinstance(connection, str):
          if connection == "datafusion":
              # Connection of None uses DataFusion
              connection = None
          elif connection == "duckdb":
              from vegafusion.connection.duckdb import DuckDbConnection
  
              connection = DuckDbConnection()
          else:
              raise ValueError(
                  f"Unsupported connection name: {connection}"
              )
      elif DuckDBPyConnection is not None and isinstance(
          connection, DuckDBPyConnection
      ):
          from vegafusion.connection.duckdb import DuckDbConnection
  
          connection = DuckDbConnection(connection)
      elif not isinstance(connection, SqlConnection):
          raise ValueError(
              "connection argument must be a string or an instance of SqlConnection\n"
              f"Received value of type {type(connection).__name__}: {connection}"
          )
  
      self._connection = connection
      self.reset()
  
imports: import pandas
  import psutil
  import pyarrow
  from typing import Union
  from .connection import SqlConnection
  from .dataset import SqlDataset, DataFrameDataset
  from .datasource import PandasDatasource, DfiDatasource
  from .evaluation import get_mark_group_for_scope
  from .transformer import import_pyarrow_interchange, to_arrow_table
  from .local_tz import get_local_tz
  from typing import TypedDict, List, Literal, Any
label_desc: Use image node_id 3 for calling the VegaFusionRuntime obj's underlying member method code with example usage: obj.set_connection(connection) without return types