[docs]classYielded(object):"""Yields from :class:`~fugue.workflow.workflow.FugueWorkflow`. Users shouldn't create this object directly. :param yid: unique id for determinism """def__init__(self,yid:str):self._yid=to_uuid(yid)def__uuid__(self)->str:"""uuid of the instance"""returnself._yid@propertydefis_set(self)->bool:# pragma: no cover"""Whether the value is set. It can be false if the parent workflow has not been executed. """raiseNotImplementedErrordef__copy__(self)->Any:# pragma: no cover"""``copy`` should have no effect"""returnselfdef__deepcopy__(self,memo:Any)->Any:# pragma: no cover"""``deepcopy`` should have no effect"""returnself
[docs]classPhysicalYielded(Yielded):"""Physical yielded object from :class:`~fugue.workflow.workflow.FugueWorkflow`. Users shouldn't create this object directly. :param yid: unique id for determinism :param storage_type: ``file`` or ``table`` """def__init__(self,yid:str,storage_type:str):super().__init__(yid)self._name=""assert_or_throw(storage_typein["file","table"],ValueError(f"{storage_type} not in (file, table) "),)self._storage_type=storage_type@propertydefis_set(self)->bool:returnself._name!=""
[docs]defset_value(self,name:str)->None:"""Set the storage name after compute :param name: name reference of the storage """self._name=name
@propertydefname(self)->str:"""The name reference of the yield"""assert_or_throw(self.is_set,"value is not set")returnself._name@propertydefstorage_type(self)->str:"""The storage type of this yield"""returnself._storage_type