def to_delayed(self): """ Convert bag item to dask Value Returns a single value. """ from dask.delayed import Value return Value(self.key, [self.dask])
def to_delayed(self): """ Convert bag to dask Values Returns list of values, one value per partition. """ from dask.delayed import Value return [Value(k, [self.dask]) for k in self._keys()]