code: def add_dimension(cls, dataset, dimension, dim_pos, values, vdim):
      import ibis
  
      data = dataset.data
      if dimension.name not in data.columns:
          if not isinstance(values, ibis.Expr) and not np.isscalar(
              values
          ):
              raise ValueError(
                  "Cannot assign %s type as a Ibis table column, "
                  "expecting either ibis.Expr or scalar."
                  % type(values).__name__
              )
          data = data.mutate(**{dimension.name: values})
      return data
  
imports: import sys
  from collections.abc import Iterable
  from functools import lru_cache
  import numpy
  from packaging.version import Version
  from ..None import util
  from ..element import Element
  from ..ndmapping import NdMapping, item_check, sorted_context
  from .None import pandas
  from .interface import Interface
  from .util import cached
label_desc: Use image node_id 22 for calling the IbisInterface obj's underlying member method code with example usage: obj.add_dimension(cls, dataset, dimension, dim_pos, values, vdim) and returns: data