flytekit.extend.TypeTransformer

class flytekit.extend.TypeTransformer(name: str, t: Type[T], enable_type_assertions: bool = True)[source]

Base transformer type that should be implemented for every python native type that can be handled by flytekit

__init__(name: str, t: Type[T], enable_type_assertions: bool = True)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(name, t[, enable_type_assertions])

Initialize self.

get_literal_type(t)

Converts the python type to a Flyte LiteralType

to_literal(ctx, python_val, python_type, …)

Converts a given python_val to a Flyte Literal, assuming the given python_val matches the declared python_type.

to_python_value(ctx, lv, expected_python_type)

Converts the given Literal to a Python Type.

Attributes

name

python_type

This returns the python type

type_assertions_enabled

Indicates if the transformer wants type assertions to be enabled at the core type engine layer