ClassTransformerResolver

class ditto.resolvers.ClassTransformerResolver(operator_transformers)[source]

Bases: ditto.api.TransformerResolver

Finds a resolver for a transformer based on the class of the source operator given

Parameters

operator_transformers (Dict[Type[BaseOperator], Type[OperatorTransformer]]) – a map of operator type and transformer type

get_transformer_for_class(task_cls)[source]

return the transformer type for a given operator type

Parameters

task_cls (Type) – the operator type (class)

Return type

Type[OperatorTransformer]

Returns

the transformer type

resolve_transformer(task)[source]

The main method to be implemented by a resolver

Parameters

task (BaseOperator) – the source task for which a transformer has to be resolved (found)

Return type

Type[OperatorTransformer]

Returns

the type of OperatorTransformer found for this BaseOperator