Parameters
The parameters of a ProcessingStep are specified by the type annotations given. These are required so the functions signature is well-defined and can be passed to the functions manifest. For larger inputs, or inputs that should depend on other computations, use a DataSlots instead.
Standard parameter types, including primitives bool, str, int, float, and list, can be passed directly.
For more complex parameters, such as argument lists and StrEnums, it is recommended to use a dataclass or Pydantic classes to create a well-described type.
from typing import Anyfrom pydantic import conlist, NonNegativeInt
def many_parameters( self, a: dict, b: int, c: conlist(int, max_length=3) = (1, 2, 3), d: bool = True) -> int:import dataclassesfrom dataclasses import dataclass
@dataclassclass SubDataclass: x: int y: float
@dataclassclass MyDataclass: i: int f: float sub: SubDataclass
def use_dataclass(self, my_dc: MyDataclass) -> int: ...from pydantic import BaseModelfrom enum import StrEnum
class Lang(StrEnum): ENGLISH = 'EN' GERMAN = 'DE'
class SubBaseModel(BaseModel): text: str number: float
class MyBaseModel(BaseModel): lang: Lang sub: SubBaseModel
def use_basemodel(self, my_bm: MyBaseModel) -> int: ...