Skip to content

kiara.modules.type_conversion

OldTypeConversionModule

create_input_schema(self)

Abstract method to implement by child classes, returns a description of the input schema of this module.

If returning a dictionary of dictionaries, the format of the return value is as follows (items with '*' are optional):

{ "[input_field_name]: { "type": "[value_type]", "doc*": "[a description of this input]", "optional*': [boolean whether this input is optional or required (defaults to 'False')] "[other_input_field_name]: { "type: ... ... }

Source code in kiara/modules/type_conversion.py
def create_input_schema(
    self,
) -> typing.Mapping[
    str, typing.Union[ValueSchema, typing.Mapping[str, typing.Any]]
]:

    inputs: typing.Mapping[str, typing.Any] = {
        "source_value": {
            "type": self.source_type,
            "doc": f"A value of type '{self.source_type}'.",
        },
        "config": {
            "type": "dict",
            "doc": "The configuration for the transformation.",
            "optional": True,
        },
    }

    return inputs

create_output_schema(self)

Abstract method to implement by child classes, returns a description of the output schema of this module.

If returning a dictionary of dictionaries, the format of the return value is as follows (items with '*' are optional):

{ "[output_field_name]: { "type": "[value_type]", "doc*": "[a description of this output]" "[other_input_field_name]: { "type: ... ... }

Source code in kiara/modules/type_conversion.py
def create_output_schema(
    self,
) -> typing.Mapping[
    str, typing.Union[ValueSchema, typing.Mapping[str, typing.Any]]
]:
    outputs = {
        "target_value": {
            "type": self.target_type,
            "doc": f"A value of type '{self.target_type}'.",
        }
    }
    return outputs

TypeConversionModuleConfig pydantic-model

source_type: str pydantic-field required

The source type.

target_type: str pydantic-field required

The target type.