flytekit.LiteralType#

class flytekit.LiteralType(simple=None, schema=None, collection_type=None, map_value_type=None, blob=None, enum_type=None, union_type=None, structured_dataset_type=None, metadata=None, structure=None, annotation=None)[source]#

This is a oneof message, only one of the kwargs may be set, representing one of the Flyte types.

Parameters
  • simple (int) – Enum type from SimpleType

  • schema (SchemaType) – Type definition for a dataframe-like object.

  • collection_type (LiteralType) – For list-like objects, this is the type of each entry in the list.

  • map_value_type (LiteralType) – For map objects, this is the type of the value. The key must always be a string.

  • blob (flytekit.models.core.types.BlobType) – For blob objects, this describes the type.

  • enum_type (flytekit.models.core.types.EnumType) – For enum objects, describes an enum

  • union_type (flytekit.models.core.types.UnionType) – For union objects, describes an python union type.

  • structure (flytekit.models.core.types.TypeStructure) – Type matching hints

  • structured_dataset_type (flytekit.models.core.types.StructuredDatasetType) – structured dataset

  • metadata (dict[Text, T]) – Additional data describing the type

  • annotation (flytekit.models.annotation.TypeAnnotation) – Additional data describing the type intended to be saturated by the client

Methods

classmethod from_flyte_idl(proto)[source]#
Parameters

proto (flyteidl.core.types_pb2.LiteralType) –

Return type

LiteralType

serialize_to_string()#
Return type

str

short_string()#
Return type

Text

to_flyte_idl()[source]#
Return type

flyteidl.core.types_pb2.LiteralType

verbose_string()#
Return type

Text

Attributes

annotation

flytekit.models.annotation.TypeAnnotation

Type

rtype

blob
collection_type

The collection value type

enum_type
is_empty
map_value_type

The Value for a dictionary. Key is always string

metadata

dict[Text, T]

Type

rtype

schema
simple
structure
structured_dataset_type
union_type