flytekit.extend.DictTransformer

class flytekit.extend.DictTransformer[source]

Transformer that transforms a univariate dictionary Dict[str, T] to a Literal Map or transforms a untyped dictionary to a JSON (struct/Generic)

__init__()[source]

Methods

__init__()

assert_type(t, v)

dict_to_generic_literal(v)

Creates a flyte-specific Literal value from a native python dictionary.

get_dict_types(t)

Return the generic Type T of the Dict

get_literal_type(t)

Transforms a native python dictionary to a flyte-specific LiteralType

guess_python_type(literal_type)

Converts the Flyte LiteralType to a python object type.

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