openclean.engine.object.function module

Handle and factory implementations for function objects that are registered with the object library.

Imports parameter declarations from flowserv. The constructor for each parameter takes at least the following arguments:

name: string

Unique parameter identifier

index: int, default=0

Index position of the parameter (for display purposes).

label: string, default=None

Human-readable parameter name.

help: string, default=None

Descriptive text for the parameter.

default: any, default=None

Optional default value.

required: bool, default=False

Is required flag.

class openclean.engine.object.function.FunctionFactory

Bases: openclean.engine.object.base.ObjectFactory

Factory for function objects. Uses dill to serialize functions.

deserialize(descriptor: Dict, data: str) openclean.engine.object.base.ObjectHandle

Convert an object serialization that was generated by the object serializer into a function handle.

Parameters
  • descriptor (dict) – Dictionary serialization for the object descriptor.

  • data (string) – Serialization for the function declaration.

Return type

openclean.engine.object.function.FunctionHandle

serialize(object: openclean.engine.object.base.ObjectHandle) Tuple[Dict, str]

Serialize the given function handle. Returns the serialized function descriptor and the serialized function declaration. The function is serialized using dill and the result converted into a string.

Parameters

object (openclean.engine.object.function.FunctionHandle) – Object of type that is supported by the serializer.

Return type

tuple of dict and string

class openclean.engine.object.function.FunctionHandle(func: Callable, name: Optional[str] = None, namespace: Optional[str] = None, label: Optional[str] = None, description: Optional[str] = None, columns: Optional[int] = None, collabels: Optional[Union[str, List[str]]] = None, outputs: Optional[int] = None, parameters: Optional[List[flowserv.model.parameter.base.Parameter]] = None)

Bases: openclean.engine.object.base.ObjectHandle

Handle for functions that are registered with the library.

name: str