flytekit.models.literals
Directory
Classes
flytekit.models.literals.Binary
def Binary(
value,
tag,
):
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object,
):
Parameter |
Type |
pb2_object |
|
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
is_empty |
|
|
tag |
|
|
value |
|
|
flytekit.models.literals.Binding
def Binding(
var,
binding,
):
An input/output binding of a variable to either static value or a node output.
Parameter |
Type |
var |
|
binding |
|
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object,
):
Parameter |
Type |
pb2_object |
|
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
binding |
|
|
is_empty |
|
|
var |
|
|
flytekit.models.literals.BindingData
def BindingData(
scalar,
collection,
promise,
map,
):
Specifies either a simple value or a reference to another output. Only one of the input arguments may be
specified.
Parameter |
Type |
scalar |
|
collection |
|
promise |
|
map |
|
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object,
):
Parameter |
Type |
pb2_object |
|
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
to_literal_model()
Converts current binding data into a Literal asserting that there are no promises in the bindings.
verbose_string()
Properties
Property |
Type |
Description |
collection |
|
|
is_empty |
|
|
map |
|
|
promise |
|
|
scalar |
|
|
value |
|
|
flytekit.models.literals.BindingDataCollection
def BindingDataCollection(
bindings,
):
A list of BindingData items.
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object,
):
Parameter |
Type |
pb2_object |
|
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
bindings |
|
|
is_empty |
|
|
flytekit.models.literals.BindingDataMap
def BindingDataMap(
bindings,
):
A map of BindingData items. Can be a recursive structure
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object,
):
Parameter |
Type |
pb2_object |
|
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
bindings |
|
|
is_empty |
|
|
flytekit.models.literals.Blob
def Blob(
metadata,
uri,
):
This literal model is used to represent binary data offloaded to some storage location which is
identifiable with a unique string. See :py:class:flytekit.FlyteFile
as an example.
Parameter |
Type |
metadata |
|
uri |
|
Methods
from_flyte_idl()
def from_flyte_idl(
proto,
):
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
is_empty |
|
|
metadata |
|
|
uri |
|
|
This is metadata for the Blob literal.
def BlobMetadata(
type,
):
Methods
from_flyte_idl()
def from_flyte_idl(
proto,
):
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
is_empty |
|
|
type |
|
|
flytekit.models.literals.Error
def Error(
failed_node_id: str,
message: str,
):
Parameter |
Type |
failed_node_id |
str |
message |
str |
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object: flyteidl.core.types_pb2.Error,
):
Parameter |
Type |
pb2_object |
flyteidl.core.types_pb2.Error |
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
failed_node_id |
|
|
is_empty |
|
|
message |
|
|
flytekit.models.literals.Literal
def Literal(
scalar: typing.Optional[flytekit.models.literals.Scalar],
collection: typing.Optional[flytekit.models.literals.LiteralCollection],
map: typing.Optional[flytekit.models.literals.LiteralMap],
hash: typing.Optional[str],
metadata: typing.Optional[typing.Dict[str, str]],
offloaded_metadata: typing.Optional[flytekit.models.literals.LiteralOffloadedMetadata],
):
This IDL message represents a literal value in the Flyte ecosystem.
Parameter |
Type |
scalar |
typing.Optional[flytekit.models.literals.Scalar] |
collection |
typing.Optional[flytekit.models.literals.LiteralCollection] |
map |
typing.Optional[flytekit.models.literals.LiteralMap] |
hash |
typing.Optional[str] |
metadata |
typing.Optional[typing.Dict[str, str]] |
offloaded_metadata |
typing.Optional[flytekit.models.literals.LiteralOffloadedMetadata] |
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object: flyteidl.core.literals_pb2.Literal,
):
Parameter |
Type |
pb2_object |
flyteidl.core.literals_pb2.Literal |
serialize_to_string()
def serialize_to_string()
def set_metadata(
metadata: typing.Dict[str, str],
):
Note: This is a mutation on the literal
Parameter |
Type |
metadata |
typing.Dict[str, str] |
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
collection |
|
|
hash |
|
|
is_empty |
|
|
map |
|
|
metadata |
|
|
offloaded_metadata |
|
|
scalar |
|
|
value |
|
|
flytekit.models.literals.LiteralCollection
def LiteralCollection(
literals,
):
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object,
):
Parameter |
Type |
pb2_object |
|
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
is_empty |
|
|
literals |
|
|
flytekit.models.literals.LiteralMap
def LiteralMap(
literals,
):
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object,
):
Parameter |
Type |
pb2_object |
|
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
is_empty |
|
|
literals |
|
|
def LiteralOffloadedMetadata(
uri: typing.Optional[str],
size_bytes: typing.Optional[int],
inferred_type: typing.Optional[flytekit.models.types.LiteralType],
):
Parameter |
Type |
uri |
typing.Optional[str] |
size_bytes |
typing.Optional[int] |
inferred_type |
typing.Optional[flytekit.models.types.LiteralType] |
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object,
):
Parameter |
Type |
pb2_object |
|
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
inferred_type |
|
|
is_empty |
|
|
size_bytes |
|
|
uri |
|
|
flytekit.models.literals.LiteralType
def LiteralType(
simple,
schema,
collection_type,
map_value_type,
blob,
enum_type,
union_type,
structured_dataset_type,
metadata,
structure,
annotation,
):
This is a oneof message, only one of the kwargs may be set, representing one of the Flyte types.
Parameter |
Type |
simple |
|
schema |
|
collection_type |
|
map_value_type |
|
blob |
|
enum_type |
|
union_type |
|
structured_dataset_type |
|
metadata |
|
structure |
|
annotation |
|
Methods
from_flyte_idl()
def from_flyte_idl(
proto,
):
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
annotation |
|
|
blob |
|
|
collection_type |
|
|
enum_type |
|
|
is_empty |
|
|
map_value_type |
|
|
metadata |
|
|
schema |
|
|
simple |
|
|
structure |
|
|
structured_dataset_type |
|
|
union_type |
|
|
flytekit.models.literals.Primitive
def Primitive(
integer: typing.Optional[int],
float_value: typing.Optional[float],
string_value: typing.Optional[str],
boolean: typing.Optional[bool],
datetime: typing.Optional[datetime.datetime],
duration: typing.Optional[datetime.timedelta],
):
This object proxies the primitives supported by the Flyte IDL system. Only one value can be set.
Parameter |
Type |
integer |
typing.Optional[int] |
float_value |
typing.Optional[float] |
string_value |
typing.Optional[str] |
boolean |
typing.Optional[bool] |
datetime |
typing.Optional[datetime.datetime] |
duration |
typing.Optional[datetime.timedelta] |
Methods
from_flyte_idl()
def from_flyte_idl(
proto,
):
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
boolean |
|
|
datetime |
|
|
duration |
|
|
float_value |
|
|
integer |
|
|
is_empty |
|
|
string_value |
|
|
value |
|
|
flytekit.models.literals.RetryStrategy
def RetryStrategy(
retries: int,
):
Parameter |
Type |
retries |
int |
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object,
):
Parameter |
Type |
pb2_object |
|
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
is_empty |
|
|
retries |
|
|
flytekit.models.literals.Scalar
def Scalar(
primitive: typing.Optional[flytekit.models.literals.Primitive],
blob: typing.Optional[flytekit.models.literals.Blob],
binary: typing.Optional[flytekit.models.literals.Binary],
schema: typing.Optional[flytekit.models.literals.Schema],
union: typing.Optional[flytekit.models.literals.Union],
none_type: typing.Optional[flytekit.models.literals.Void],
error: typing.Optional[flytekit.models.types.Error],
generic: typing.Optional[google.protobuf.struct_pb2.Struct],
structured_dataset: typing.Optional[flytekit.models.literals.StructuredDataset],
):
Scalar wrapper around Flyte types. Only one can be specified.
Parameter |
Type |
primitive |
typing.Optional[flytekit.models.literals.Primitive] |
blob |
typing.Optional[flytekit.models.literals.Blob] |
binary |
typing.Optional[flytekit.models.literals.Binary] |
schema |
typing.Optional[flytekit.models.literals.Schema] |
union |
typing.Optional[flytekit.models.literals.Union] |
none_type |
typing.Optional[flytekit.models.literals.Void] |
error |
typing.Optional[flytekit.models.types.Error] |
generic |
typing.Optional[google.protobuf.struct_pb2.Struct] |
structured_dataset |
typing.Optional[flytekit.models.literals.StructuredDataset] |
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object,
):
Parameter |
Type |
pb2_object |
|
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
binary |
|
|
blob |
|
|
error |
|
|
generic |
|
|
is_empty |
|
|
none_type |
|
|
primitive |
|
|
schema |
|
|
structured_dataset |
|
|
union |
|
|
value |
|
|
flytekit.models.literals.Schema
def Schema(
uri,
type,
):
A strongly typed schema that defines the interface of data retrieved from the underlying storage medium.
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object,
):
Parameter |
Type |
pb2_object |
|
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
is_empty |
|
|
type |
|
|
uri |
|
|
flytekit.models.literals.Struct
A ProtocolMessage
Methods
get_or_create_list()
def get_or_create_list(
key,
):
Returns a list for this key, creating if it didn’t exist already.
get_or_create_struct()
def get_or_create_struct(
key,
):
Returns a struct for this key, creating if it didn’t exist already.
items()
keys()
update()
def update(
dictionary,
):
Parameter |
Type |
dictionary |
|
values()
flytekit.models.literals.StructuredDataset
def StructuredDataset(
uri: str,
metadata: typing.Optional[flytekit.models.literals.StructuredDatasetMetadata],
):
A strongly typed schema that defines the interface of data retrieved from the underlying storage medium.
Parameter |
Type |
uri |
str |
metadata |
typing.Optional[flytekit.models.literals.StructuredDatasetMetadata] |
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object: flyteidl.core.literals_pb2.StructuredDataset,
):
Parameter |
Type |
pb2_object |
flyteidl.core.literals_pb2.StructuredDataset |
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
is_empty |
|
|
metadata |
|
|
uri |
|
|
def StructuredDatasetMetadata(
structured_dataset_type: typing.Optional[flytekit.models.types.StructuredDatasetType],
):
Parameter |
Type |
structured_dataset_type |
typing.Optional[flytekit.models.types.StructuredDatasetType] |
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object: flyteidl.core.literals_pb2.StructuredDatasetMetadata,
):
Parameter |
Type |
pb2_object |
flyteidl.core.literals_pb2.StructuredDatasetMetadata |
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
is_empty |
|
|
structured_dataset_type |
|
|
flytekit.models.literals.StructuredDatasetType
def StructuredDatasetType(
columns: typing.List[flytekit.models.types.StructuredDatasetType.DatasetColumn],
format: str,
external_schema_type: str,
external_schema_bytes: bytes,
):
Parameter |
Type |
columns |
typing.List[flytekit.models.types.StructuredDatasetType.DatasetColumn] |
format |
str |
external_schema_type |
str |
external_schema_bytes |
bytes |
Methods
from_flyte_idl()
def from_flyte_idl(
proto: flyteidl.core.types_pb2.StructuredDatasetType,
):
Parameter |
Type |
proto |
flyteidl.core.types_pb2.StructuredDatasetType |
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
columns |
|
|
external_schema_bytes |
|
|
external_schema_type |
|
|
format |
|
|
is_empty |
|
|
flytekit.models.literals.Union
def Union(
value,
stored_type,
):
The runtime representation of a tagged union value. See UnionType
for more details.
Parameter |
Type |
value |
|
stored_type |
|
Methods
from_flyte_idl()
def from_flyte_idl(
pb2_object,
):
Parameter |
Type |
pb2_object |
|
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
is_empty |
|
|
stored_type |
|
|
value |
|
|
flytekit.models.literals.Void
Methods
from_flyte_idl()
def from_flyte_idl(
proto,
):
serialize_to_string()
def serialize_to_string()
short_string()
to_flyte_idl()
verbose_string()
Properties
Property |
Type |
Description |
is_empty |
|
|