code: def __init__(self, dataframe: DfiDataFrame):
      if hasattr(dataframe, "__dataframe__"):
          dataframe = dataframe.__dataframe__()
      fields = []
      for col in dataframe.column_names():
          field = dataframe.get_column_by_name(col)
          pa_type = map_date_type(field.dtype)
          fields.append(pa.field(col, pa_type))
  
      self._dataframe = dataframe
      self._schema = pa.schema(fields)
  
file_path: vegafusion/python/vegafusion/vegafusion/datasource/dfi_datasource.py
imports: from typing import Iterable
  import re
  import pyarrow
  from typing import Any, Dict
  from ._dfi_types import DtypeKind, DataFrame
  from .datasource import Datasource
label_desc: Use image node_id 1 to create a new DfiDatasource object from inherited base classes: Datasource with example: obj = DfiDatasource(dataframe)