dag_generator.results.base_result
ResultType Objects
class ResultType(Enum)
A class for all types of results. Only these types of results are allowed to be used. Try to avoid writing the result types manually
BaseResult Objects
class BaseResult(LoggingMixin, metaclass=ABCMeta)
__init__
def __init__(operator: TBaseOperator, work: BaseWork, name: str, **kwargs)
Base class for all results. The result is created at the end of the operator's work and stored into work. The operator always returns one result
Arguments:
operator
: Operator that generates the resultwork
: Work in which the result will be savedname
: Name of the result with which it will be saved in workkwargs
: Additional parameters for BaseResult
write_df
@abstractmethod
def write_df(obj: DataFrame, context: dict)
This method is responsible for working with the DataFrame
Arguments:
obj
: object to be written to workcontext
: context
write
@abstractmethod
def write(obj: Union[Any, DataFrame], context: dict)
Basic logic of writing the result
Arguments:
obj
: Object to be writtencontext
: context
read_df
@abstractmethod
def read_df(context: dict) -> DataFrame
Read DataFrame
Arguments:
context
: context
Returns:
Object read from work
read
@abstractmethod
def read(context: dict) -> Union[Any, DataFrame]
Reading of any result
Arguments:
context
: context
Returns:
Object read from work