flytekit.models package

Submodules

flytekit.models.array_job module

class flytekit.models.array_job.ArrayJob(parallelism, size, min_successes)[source]

Bases: flytekit.models.common.FlyteCustomIdlEntity

classmethod from_dict(idl_dict)[source]
Parameters

Text] idl_dict (dict[T,) –

Return type

ArrayJob

property min_successes
An absolute number of the minimum number of successful completions of subtasks. As soon as this criteria is met,

the array job will be marked as successful and outputs will be computed.

Return type

int

property parallelism

Defines the minimum number of instances to bring up concurrently at any given point.

Return type

int

property size

Defines the number of instances to launch at most. This number should match the size of the input if the job requires processing of all input data. This has to be a positive number.

Return type

int

to_dict()[source]
Return type

dict[T, Text]

flytekit.models.common module

class flytekit.models.common.Annotations(values)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.common_pb2.Annotations) –

Return type

Annotations

to_flyte_idl()[source]
Return type

_common_pb2.Annotations

property values
class flytekit.models.common.EmailNotification(recipients_email)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.common_pb2.EmailNotification) –

Return type

EmailNotification

property recipients_email
Return type

list[Text]

to_flyte_idl()[source]
Return type

flyteidl.admin.common_pb2.EmailNotification

class flytekit.models.common.FlyteABCMeta[source]

Bases: abc.ABCMeta

class flytekit.models.common.FlyteCustomIdlEntity[source]

Bases: flytekit.models.common.FlyteIdlEntity

abstract from_dict(idl_dict)[source]
classmethod from_flyte_idl(idl_object)[source]
Parameters

idl_object (_struct.Struct) –

Returns

FlyteCustomIdlEntity

abstract to_dict()[source]

Converts self to a dictionary. :rtype: dict[Text, T]

to_flyte_idl()[source]
class flytekit.models.common.FlyteIdlEntity[source]

Bases: object

short_string()[source]
Return type

Text

abstract to_flyte_idl()[source]
verbose_string()[source]
Return type

Text

class flytekit.models.common.FlyteType[source]

Bases: flytekit.models.common.FlyteABCMeta

abstract from_flyte_idl(idl_object)[source]
short_class_string()[source]
Return type

Text

verbose_class_string()[source]
Return type

Text

class flytekit.models.common.Labels(values)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.common_pb2.Labels) –

Return type

Labels

to_flyte_idl()[source]
Return type

dict[Text, Text]

property values
class flytekit.models.common.NamedEntityIdentifier(project, domain, name=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property domain

The name of the domain within the project. :rtype: Text

classmethod from_flyte_idl(idl_object)[source]
Parameters

idl_object (flyteidl.admin.common_pb2.NamedEntityIdentifier) –

Return type

NamedEntityIdentifier

property name

The name of the entity within the namespace of the project and domain. :rtype: Text

property project

The name of the project in which this entity lives. :rtype: Text

to_flyte_idl()[source]

Stores object to a Flyte-IDL defined protobuf. :rtype: flyteidl.admin.common_pb2.NamedEntityIdentifier

class flytekit.models.common.Notification(phases, email=None, pager_duty=None, slack=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property email
Return type

EmailNotification

classmethod from_flyte_idl(p)[source]
Parameters

p (flyteidl.admin.common_pb2.Notification) –

Return type

Notification

property pager_duty
Return type

PagerDutyNotification

property phases

A list of phases to which users can associate the notifications. :rtype: list[int]

property slack
Return type

SlackNotification

to_flyte_idl()[source]
Return type

flyteidl.admin.common_pb2.Notification

class flytekit.models.common.PagerDutyNotification(recipients_email)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.common_pb2.PagerDutyNotification) –

Return type

EmailNotification

property recipients_email
Return type

list[Text]

to_flyte_idl()[source]
Return type

flyteidl.admin.common_pb2.PagerDutyNotification

class flytekit.models.common.SlackNotification(recipients_email)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.common_pb2.SlackNotification) –

Return type

EmailNotification

property recipients_email
Return type

list[Text]

to_flyte_idl()[source]
Return type

flyteidl.admin.common_pb2.SlackNotification

class flytekit.models.common.UrlBlob(url, bytes)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property bytes
Return type

int

classmethod from_flyte_idl(pb)[source]
Parameters

pb (flyteidl.admin.common_pb2.UrlBlob) –

Return type

UrlBlob

to_flyte_idl()[source]
Return type

flyteidl.admin.common_pb2.UrlBlob

property url
Return type

Text

flytekit.models.dynamic_job module

class flytekit.models.dynamic_job.DynamicJobSpec(tasks, nodes, min_successes, outputs, subworkflows)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.dynamic_job_pb2.DynamicJobSpec) –

Returns

DynamicJobSpec

property min_successes
An absolute number of the minimum number of successful completions of subtasks. As

soon as this criteria is met, the future job will be marked as successful and outputs will be computed.

Return type

int

property nodes

A collection of dynamic nodes. :rtype: list[_workflow.Node]

property outputs
Describes how to bind the final output of the future task from the outputs of executed nodes.

The referenced ids in bindings should have the generated id for the subtask.

Return type

list[flytekit.models.literals.Binding]

property subworkflows

A collection of subworkflows to execute. :rtype: list[flytekit.models.core.workflow.WorkflowTemplate]

property tasks

A collection of tasks to execute. :rtype: list[_task.TaskTemplate]

to_flyte_idl()[source]
Return type

flyteidl.core.dynamic_job.DynamicJobSpec

flytekit.models.execution module

class flytekit.models.execution.Execution(id, spec, closure)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property closure
Return type

ExecutionClosure

classmethod from_flyte_idl(pb)[source]
Parameters

pb (flyteidl.admin.execution_pb2.Execution) –

Return type

Execution

property id
Return type

flytekit.models.core.identifier.WorkflowExecutionIdentifier

property spec
Return type

ExecutionSpec

to_flyte_idl()[source]
Return type

flyteidl.admin.execution_pb2.Execution

class flytekit.models.execution.ExecutionClosure(phase, started_at, error=None, outputs=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property error
Return type

flytekit.models.core.execution.ExecutionError

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.execution_pb2.ExecutionClosure) –

Return type

ExecutionClosure

property outputs
Return type

LiteralMapBlob

property phase

From the flytekit.models.core.execution.WorkflowExecutionPhase enum :rtype: int

property started_at
Return type

datetime.datetime

to_flyte_idl()[source]
Return type

flyteidl.admin.execution_pb2.ExecutionClosure

class flytekit.models.execution.ExecutionMetadata(mode, principal, nesting)[source]

Bases: flytekit.models.common.FlyteIdlEntity

class ExecutionMode[source]

Bases: object

MANUAL = 0
SCHEDULED = 1
SYSTEM = 2
classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.execution_pb2.ExecutionMetadata) –

Returns

ExecutionMetadata

property mode

An enum value from ExecutionMetadata.ExecutionMode which specifies how the job started. :rtype: int

property nesting

An integer representing how deeply nested the workflow is (i.e. was it triggered by a parent workflow) :rtype: int

property principal

The entity that triggered the execution :rtype: Text

to_flyte_idl()[source]
Return type

flyteidl.admin.execution_pb2.ExecutionMetadata

class flytekit.models.execution.ExecutionSpec(launch_plan, metadata, notifications=None, disable_all=None, labels=None, annotations=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property annotations
Return type

flytekit.models.common.Annotations

property disable_all
Return type

Optional[bool]

classmethod from_flyte_idl(p)[source]
Parameters

p (flyteidl.admin.execution_pb2.ExecutionSpec) –

Returns

ExecutionSpec

property labels
Return type

flytekit.models.common.Labels

property launch_plan

If the values were too large, this is the URI where the values were offloaded. :rtype: flytekit.models.core.identifier.Identifier

property metadata
Return type

ExecutionMetadata

property notifications
Return type

Optional[NotificationList]

to_flyte_idl()[source]
Return type

flyteidl.admin.execution_pb2.ExecutionSpec

class flytekit.models.execution.LiteralMapBlob(values=None, uri=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb)[source]
Parameters

pb (flyteidl.admin.execution_pb2.LiteralMapBlob) –

Return type

LiteralMapBlob

to_flyte_idl()[source]
Return type

flyteidl.admin.execution_pb2.LiteralMapBlob

property uri
Return type

Text

property values
Return type

flytekit.models.literals.LiteralMap

class flytekit.models.execution.NodeExecutionGetDataResponse(inputs, outputs)[source]

Bases: flytekit.models.execution._CommonDataResponse

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (_node_execution_pb2.NodeExecutionGetDataResponse) –

Return type

NodeExecutionGetDataResponse

to_flyte_idl()[source]
Return type

_node_execution_pb2.NodeExecutionGetDataResponse

class flytekit.models.execution.NotificationList(notifications)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.execution_pb2.NotificationList) –

Return type

NotificationList

property notifications
Return type

list[flytekit.models.common.Notification]

to_flyte_idl()[source]
Return type

flyteidl.admin.execution_pb2.NotificationList

class flytekit.models.execution.TaskExecutionGetDataResponse(inputs, outputs)[source]

Bases: flytekit.models.execution._CommonDataResponse

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (_task_execution_pb2.TaskExecutionGetDataResponse) –

Return type

TaskExecutionGetDataResponse

to_flyte_idl()[source]
Return type

_task_execution_pb2.TaskExecutionGetDataResponse

class flytekit.models.execution.WorkflowExecutionGetDataResponse(inputs, outputs)[source]

Bases: flytekit.models.execution._CommonDataResponse

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (_execution_pb2.WorkflowExecutionGetDataResponse) –

Return type

WorkflowExecutionGetDataResponse

to_flyte_idl()[source]
Return type

_execution_pb2.WorkflowExecutionGetDataResponse

flytekit.models.filters module

class flytekit.models.filters.Contains(key, values)[source]

Bases: flytekit.models.filters.SetFilter

class flytekit.models.filters.Equal(key, value)[source]

Bases: flytekit.models.filters.Filter

class flytekit.models.filters.Filter(key, value)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl()[source]
classmethod from_python_std(string)[source]
Parameters

string (Text) –

Return type

Filter

to_flyte_idl()[source]

For supporting the auto-generated REST API, filters must be dumped to a string for representation as GET params. :rtype: Text

class flytekit.models.filters.FilterList(filter_list)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl()[source]
to_flyte_idl()[source]

For supporting the auto-generated REST API, filters must be dumped to a string for representation as GET params. :rtype: Text

class flytekit.models.filters.GreaterThan(key, value)[source]

Bases: flytekit.models.filters.Filter

class flytekit.models.filters.GreaterThanOrEqual(key, value)[source]

Bases: flytekit.models.filters.Filter

class flytekit.models.filters.LessThan(key, value)[source]

Bases: flytekit.models.filters.Filter

class flytekit.models.filters.LessThanOrEqual(key, value)[source]

Bases: flytekit.models.filters.Filter

class flytekit.models.filters.NotEqual(key, value)[source]

Bases: flytekit.models.filters.Filter

class flytekit.models.filters.SetFilter(key, values)[source]

Bases: flytekit.models.filters.Filter

class flytekit.models.filters.ValueIn(key, values)[source]

Bases: flytekit.models.filters.SetFilter

flytekit.models.interface module

class flytekit.models.interface.Parameter(var, default=None, required=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property behavior
Return type

T

property default

This is the default literal value that will be applied for this parameter if not user specified. :rtype: flytekit.models.literals.Literal

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.interface_pb2.Parameter) –

Return type

Parameter

property required

If True, this parameter must be specified. There cannot be a default value. :rtype: bool

to_flyte_idl()[source]
Return type

flyteidl.core.interface_pb2.Parameter

property var

The variable definition for this input parameter. :rtype: Variable

class flytekit.models.interface.ParameterMap(parameters)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.interface_pb2.ParameterMap) –

Return type

ParameterMap

property parameters
Return type

dict[Text, Parameter]

to_flyte_idl()[source]
Return type

flyteidl.core.interface_pb2.ParameterMap

class flytekit.models.interface.TypedInterface(inputs, outputs)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(proto)[source]
Parameters

proto (flyteidl.core.interface_pb2.TypedInterface) –

Return type

TypedInterface

property inputs
Return type

dict[Text, Variable]

property outputs
Return type

dict[Text, Variable]

to_flyte_idl()[source]
Return type

flyteidl.core.interface_pb2.TypedInterface

class flytekit.models.interface.Variable(type, description)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property description

This is a help string that can provide context for what this variable means in relation to a task or workflow. :rtype: Text

classmethod from_flyte_idl(variable_proto)[source]
Parameters

variable_proto (flyteidl.core.interface_pb2.Variable) –

Return type

Variable

to_flyte_idl()[source]
Return type

flyteidl.core.interface_pb2.Variable

property type

This describes the type of value that must be provided to satisfy this variable. :rtype: flytekit.models.types.LiteralType

class flytekit.models.interface.VariableMap(variables)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

Variable] pb2_object (dict[Text,) –

Return type

VariableMap

to_flyte_idl()[source]
Return type

dict[Text, Variable]

property variables
Return type

dict[Text, Variable]

flytekit.models.launch_plan module

class flytekit.models.launch_plan.Auth(assumable_iam_role=None, kubernetes_service_account=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property assumable_iam_role

The IAM role to execute the workflow with :rtype: Text

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.launch_plan_pb2.Auth) –

Return type

Auth

property kubernetes_service_account

The kubernetes service account to execute the workflow with :rtype: Text

to_flyte_idl()[source]
Return type

flyteidl.admin.launch_plan_pb2.Auth

class flytekit.models.launch_plan.LaunchPlan(id, spec, closure)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property closure
Return type

LaunchPlanClosure

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.launch_plan_pb2.LaunchPlan) –

Return type

LaunchPlan

property id
Return type

flytekit.models.core.identifier.Identifier

property spec
Return type

LaunchPlanSpec

to_flyte_idl()[source]
Return type

flyteidl.admin.launch_plan_pb2.LaunchPlan

class flytekit.models.launch_plan.LaunchPlanClosure(state, expected_inputs, expected_outputs)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property expected_inputs
Return type

flytekit.models.interface.ParameterMap

property expected_outputs
Return type

flytekit.models.interface.VariableMap

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.launch_plan_pb2.LaunchPlanClosure) –

Return type

LaunchPlanClosure

property state
Return type

LaunchPlanState

to_flyte_idl()[source]
Return type

flyteidl.admin.launch_plan_pb2.LaunchPlanClosure

class flytekit.models.launch_plan.LaunchPlanMetadata(schedule, notifications)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.launch_plan_pb2.LaunchPlanMetadata) –

Return type

LaunchPlanMetadata

property notifications

List of notifications based on Execution status transitions :rtype: list[flytekit.models.common.Notification]

property schedule

Schedule to execute the Launch Plan :rtype: flytekit.models.schedule.Schedule

to_flyte_idl()[source]

List of notifications based on Execution status transitions :rtype: flyteidl.admin.launch_plan_pb2.LaunchPlanMetadata

class flytekit.models.launch_plan.LaunchPlanSpec(workflow_id, entity_metadata, default_inputs, fixed_inputs, labels, annotations, auth)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property annotations

The annotations to execute the workflow with :rtype: flytekit.models.common.Annotations

property auth

The authorization method with which to execute the workflow. :return: flytekit.models.launch_plan.Auth

property default_inputs

Input values to be passed for the execution :rtype: flytekit.models.interface.ParameterMap

property entity_metadata
Return type

LaunchPlanMetadata

property fixed_inputs

Fixed, non-overridable inputs for the Launch Plan :rtype: flytekit.models.literals.LiteralMap

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.launch_plan_pb2.LaunchPlanSpec) –

Return type

LaunchPlanSpec

property labels

The labels to execute the workflow with :rtype: flytekit.models.common.Labels

to_flyte_idl()[source]
Return type

flyteidl.admin.launch_plan_pb2.LaunchPlanSpec

property workflow_id

Unique identifier for the workflow in question :rtype: flytekit.models.core.identifier.Identifier

class flytekit.models.launch_plan.LaunchPlanState[source]

Bases: object

ACTIVE = 1
INACTIVE = 0
classmethod enum_to_string(val)[source]
Parameters

val (int) –

Return type

Text

flytekit.models.literals module

class flytekit.models.literals.Binary(value, tag)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.literals_pb2.Binary) –

Return type

Binary

property tag
Return type

Text

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.Binary

property value
Return type

bytes

class flytekit.models.literals.Binding(var, binding)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property binding

Data to use to bind this variable. :rtype: BindingData

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.literals_pb2.Binding) –

Return type

flytekit.core.models.literals.Binding

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.Binding

property var

A variable name, must match an input or output variable of the node. :rtype: Text

class flytekit.models.literals.BindingData(scalar=None, collection=None, promise=None, map=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property collection

[Optional] A collection of binding data. This allows nesting of binding data to any number of levels. :rtype: BindingDataCollection

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.literals_pb2.BindingData) –

Returns

BindingData

property map

[Optional] A map of bindings. The key is always a string. :rtype: BindingDataMap

property promise

[Optional] References an output promised by another node. :rtype: flytekit.models.types.OutputReference

property scalar

A simple scalar value. :rtype: Scalar

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.BindingData

to_literal_model()[source]

Converts current binding data into a Literal asserting that there are no promises in the bindings. :rtype: Literal

property value

Returns whichever value is set :rtype: T

class flytekit.models.literals.BindingDataCollection(bindings)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property bindings
Return type

list[BindingData]

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.literals_pb2.BindingDataCollection) –

Return type

flytekit.models.literals.BindingDataCollection

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.BindingDataCollection

class flytekit.models.literals.BindingDataMap(bindings)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property bindings

Map of strings to Bindings :rtype: dict[string, BindingData]

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.literals_pb2.BindingDataMap) –

Return type

flytekit.models.literals.BindingDataMap

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.BindingDataMap

class flytekit.models.literals.Blob(metadata, uri)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(proto)[source]
Parameters

proto (flyteidl.core.literals_pb2.Blob) –

Return type

Blob

property metadata
Return type

BlobMetadata

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.Blob

property uri
Return type

Text

class flytekit.models.literals.BlobMetadata(type)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(proto)[source]
Parameters

proto (flyteidl.core.literals_pb2.BlobMetadata) –

Return type

BlobMetadata

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.BlobMetadata

property type
Return type

flytekit.models.core.types.BlobType

class flytekit.models.literals.Literal(scalar=None, collection=None, map=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property collection

If not None, this value holds a collection of Literal values which can be further unpacked. :rtype: LiteralCollection

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.literals_pb2.Literal) –

Return type

Literal

property map

If not None, this value holds a map of Literal values which can be further unpacked. :rtype: LiteralMap

property scalar

If not None, this value holds a scalar value which can be further unpacked. :rtype: Scalar

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.Literal

property value

Returns one of the scalar, collection, or map properties based on which one is set. :rtype: T

class flytekit.models.literals.LiteralCollection(literals)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.literals_pb2.LiteralCollection) –

Return type

LiteralCollection

property literals
Return type

list[Literal]

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.LiteralCollection

class flytekit.models.literals.LiteralMap(literals)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.literals_pb2.LiteralMap) –

Return type

LiteralMap

property literals

A dictionary mapping Text key names to Literal objects. :rtype: dict[Text, Literal]

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.LiteralMap

class flytekit.models.literals.Primitive(integer=None, float_value=None, string_value=None, boolean=None, datetime=None, duration=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property boolean
Return type

bool

property datetime
Return type

datetime.datetime

property duration
Return type

datetime.timedelta

property float_value
Return type

float

classmethod from_flyte_idl(proto)[source]
Parameters

proto (flyteidl.core.literals_pb2.Primitive) –

Return type

Primitive

property integer
Return type

int

property string_value
Return type

Text

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.Primitive

property value

This returns whichever field is set. :rtype: T

class flytekit.models.literals.RetryStrategy(retries)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.literals_pb2.RetryStrategy) –

Return type

RetryStrategy

property retries

Number of retries to attempt on recoverable failures. If retries is 0, then only one attempt will be made. :rtype: int

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.RetryStrategy

class flytekit.models.literals.Scalar(primitive=None, blob=None, binary=None, schema=None, none_type=None, error=None, generic=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property binary
Return type

Binary

property blob
Return type

Blob

property error
Return type

TODO

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.literals_pb2.Scalar) –

Return type

flytekit.models.literals.Scalar

property generic
Return type

google.protobuf.struct_pb2.Struct

property none_type
Return type

Void

property primitive
Return type

Primitive

property schema
Return type

Schema

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.Scalar

property value

Returns whichever value is set :rtype: T

class flytekit.models.literals.Schema(uri, type)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.literals_pb2.Schema) –

Return type

Schema

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.Schema

property type
Return type

flytekit.models.types.SchemaType

property uri
Return type

Text

class flytekit.models.literals.Void[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(proto)[source]
Parameters

proto (flyteidl.core.literals_pb2.Void) –

Return type

Void

to_flyte_idl()[source]
Return type

flyteidl.core.literals_pb2.Void

flytekit.models.node_execution module

class flytekit.models.node_execution.NodeExecution(id, input_uri, closure)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property closure
Return type

NodeExecutionClosure

classmethod from_flyte_idl(p)[source]
Parameters

p (flyteidl.admin.node_execution_pb2.NodeExecution) –

Return type

NodeExecution

property id
Return type

flytekit.models.core.identifier.NodeExecutionIdentifier

property input_uri
Return type

Text

to_flyte_idl()[source]
Return type

flyteidl.admin.node_execution_pb2.NodeExecution

class flytekit.models.node_execution.NodeExecutionClosure(phase, started_at, duration, output_uri=None, error=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property duration
Return type

datetime.timedelta

property error
Return type

flytekit.models.core.execution.ExecutionError

classmethod from_flyte_idl(p)[source]
Parameters

p (flyteidl.admin.node_execution_pb2.NodeExecutionClosure) –

Return type

NodeExecutionClosure

property output_uri
Return type

Text

property phase
Return type

int

property started_at
Return type

datetime.datetime

to_flyte_idl()[source]
Return type

flyteidl.admin.node_execution_pb2.NodeExecutionClosure

flytekit.models.project module

class flytekit.models.project.Project(id, name)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.project_pb2.Project) –

Return type

Project

property id

A globally unique identifier associated with this project :rtype: Text

property name

A human-readable name for this project. :rtype: Text

to_flyte_idl()[source]
Return type

flyteidl.admin.project_pb2.Project

flytekit.models.qubole module

class flytekit.models.qubole.HiveQuery(query, timeout_sec, retry_count)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (_qubole.HiveQuery) –

Returns

HiveQuery

property query

The query string. :rtype: str

property retry_count
Return type

int

property timeout_sec
Return type

int

to_flyte_idl()[source]
Return type

_qubole.HiveQuery

class flytekit.models.qubole.HiveQueryCollection(queries)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (_qubole.HiveQuery) –

Return type

HiveQueryCollection

property queries
Return type

list[HiveQuery]

to_flyte_idl()[source]
Return type

_qubole.HiveQueryCollection

class flytekit.models.qubole.QuboleHiveJob(query, cluster_label, tags, query_collection=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property cluster_label

The cluster label where the query should be executed :rtype: Text

classmethod from_flyte_idl(p)[source]
Parameters

p (_qubole.QuboleHiveJob) –

Return type

QuboleHiveJob

property query

The query to be executed :rtype: HiveQuery

property query_collection

The queries to be executed :rtype: HiveQueryCollection

property tags

User tags for the queries :rtype: list[Text]

to_flyte_idl()[source]
Return type

_qubole.QuboleHiveJob

flytekit.models.schedule module

class flytekit.models.schedule.Schedule(kickoff_time_input_arg, cron_expression=None, rate=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

class FixedRate(value, unit)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.schedule_pb2.FixedRate) –

Return type

Schedule.FixedRate

to_flyte_idl()[source]
Return type

flyteidl.admin.schedule_pb2.FixedRate

property unit
Return type

int

property value
Return type

int

class FixedRateUnit[source]

Bases: object

DAY = 2
HOUR = 1
MINUTE = 0
classmethod enum_to_string(int_value)[source]
Parameters

int_value

Return type

Text

property cron_expression
Return type

Text

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.schedule_pb2.Schedule) –

Return type

Schedule

property kickoff_time_input_arg
property rate
Return type

Schedule.FixedRate

property schedule_expression
to_flyte_idl()[source]
Return type

flyteidl.admin.schedule_pb2.Schedule

flytekit.models.task module

class flytekit.models.task.CompiledTask(template)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.compiler_pb2.CompiledTask) –

Return type

CompiledTask

property template
Return type

TaskTemplate

to_flyte_idl()[source]
Return type

flyteidl.core.compiler_pb2.CompiledTask

class flytekit.models.task.Container(image, command, args, resources, env, config)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property args

A list of arguments for the command. i.e. [‘s3://some/path’, ‘/tmp/local/path’]

Return type

list[Text]

property command

A list of ‘words’ for the command. i.e. [‘aws’, ‘s3’, ‘ls’] :rtype: list[Text]

property config
A definition of key-value pairs for configuration. Currently, only str->str is

supported.

Return type

dict[Text, Text]

property env
A definition of key-value pairs for environment variables. Currently, only str->str is

supported.

Return type

dict[Text, Text]

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.task_pb2.Task) –

Return type

Container

property image

The fully-qualified identifier for the image. :rtype: Text

property resources

A definition of requisite compute resources. :rtype: Resources

to_flyte_idl()[source]
Return type

flyteidl.core.tasks_pb2.Container

class flytekit.models.task.Resources(requests, limits)[source]

Bases: flytekit.models.common.FlyteIdlEntity

class ResourceEntry(name, value)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.tasks_pb2.Resources.ResourceEntry) –

Return type

Resources.ResourceEntry

property name

enum value from ResourceName :rtype: int

to_flyte_idl()[source]
Return type

flyteidl.core.tasks_pb2.ResourceEntry

property value

A textual value describing the resource need. Must be a valid k8s quantity. :rtype: Text

class ResourceName[source]

Bases: object

CPU = 1
GPU = 2
MEMORY = 3
STORAGE = 4
UNKNOWN = 0
classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.tasks_pb2.Resources.ResourceEntry) –

Return type

Resources

property limits

These are the limits required. These are guaranteed to be satisfied. :rtype: list[Resources.ResourceEntry]

property requests

The desired resources for execution. This is given on a best effort basis. :rtype: list[Resources.ResourceEntry]

to_flyte_idl()[source]
Return type

flyteidl.core.tasks_pb2.Resources

class flytekit.models.task.RuntimeMetadata(type, version, flavor)[source]

Bases: flytekit.models.common.FlyteIdlEntity

class RuntimeType[source]

Bases: object

FLYTE_SDK = 1
OTHER = 0
property flavor

Optional extra information about runtime environment (e.g. Python, GoLang, etc.) :rtype: Text

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.tasks_pb2.RuntimeMetadata) –

Return type

RuntimeMetadata

to_flyte_idl()[source]
Return type

flyteidl.core.tasks_pb2.RuntimeMetadata

property type

Enum type from RuntimeMetadata.RuntimeType :rtype: int

property version

Version string for SDK version. Can be used for metrics or managing breaking changes in Admin or Propeller :rtype: Text

class flytekit.models.task.SidecarJob(pod_spec, primary_container_name)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.task_pb2.Task) –

Return type

Container

property pod_spec
Return type

k8s.io.api.core.v1.PodSpec

property primary_container_name
Return type

Text

to_flyte_idl()[source]
Return type

flyteidl.core.tasks_pb2.SidecarJob

class flytekit.models.task.SparkJob(application_file, spark_conf, hadoop_conf, executor_path)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property application_file

The main application file to execute :rtype: Text

property executor_path

The python executable to use :rtype: Text

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.plugins.spark_pb2.SparkJob) –

Return type

SparkJob

property hadoop_conf

A definition of key-value pairs for hadoop config for the job.

Return type

dict[Text, Text]

property spark_conf
A definition of key-value pairs for spark config for the job.
rtype

dict[Text, Text]

to_flyte_idl()[source]
Return type

flyteidl.plugins.spark_pb2.SparkJob

class flytekit.models.task.Task(id, closure)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property closure

The closure for the underlying workload. :rtype: TaskClosure

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.task_pb2.Task) –

Return type

TaskDefinition

property id

The (project, domain, name, version) identifier for this task. :rtype: flytekit.models.core.identifier.Identifier

to_flyte_idl()[source]
Return type

flyteidl.admin.task_pb2.Task

class flytekit.models.task.TaskClosure(compiled_task)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property compiled_task
Return type

CompiledTask

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.task_pb2.TaskClosure) –

Return type

TaskClosure

to_flyte_idl()[source]
Return type

flyteidl.admin.task_pb2.TaskClosure

class flytekit.models.task.TaskMetadata(discoverable, runtime, timeout, retries, discovery_version, deprecated_error_message)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property deprecated_error_message

This string can be used to mark the task as deprecated. Consumers of the task will receive deprecation warnings. :rtype: Text

property discoverable

Whether or not the outputs of this task should be cached for discovery. :rtype: bool

property discovery_version

This is the version used to create a logical version for data in the cache. This is only used when discoverable is true. Data is considered discoverable if: the inputs to a given task are the same and the discovery_version is also the same. :rtype: Text

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.task_pb2.TaskMetadata) –

Return type

TaskMetadata

property retries

Retry strategy for this task. 0 retries means only try once. :rtype: flytekit.models.literals.RetryStrategy

property runtime

Metadata describing the runtime environment for this task. :rtype: RuntimeMetadata

property timeout

The amount of time to wait before timing out. This includes queuing and scheduler latency. :rtype: datetime.timedelta

to_flyte_idl()[source]
Return type

flyteidl.admin.task_pb2.TaskMetadata

class flytekit.models.task.TaskSpec(template)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.admin.tasks_pb2.TaskSpec) –

Return type

TaskSpec

property template
Return type

TaskTemplate

to_flyte_idl()[source]
Return type

flyteidl.admin.tasks_pb2.TaskSpec

class flytekit.models.task.TaskTemplate(id, type, metadata, interface, custom, container=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property container

If not None, the target of execution should be a container. :rtype: Container

property custom

Arbitrary dictionary containing metadata for custom plugins. :rtype: dict[Text, T]

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.tasks_pb2.TaskTemplate) –

Return type

TaskTemplate

property id

This is generated by the system and uniquely identifies the task. :rtype: flytekit.models.core.identifier.Identifier

property interface

The interface definition for this task. :rtype: flytekit.common.interface.TypedInterface

property metadata

This contains information needed at runtime to determine behavior such as whether or not outputs are discoverable, timeouts, and retries. :rtype: TaskMetadata

to_flyte_idl()[source]
Return type

flyteidl.core.tasks_pb2.TaskTemplate

property type

This is used to identify additional extensions for use by Propeller or SDK. :rtype: Text

flytekit.models.types module

class flytekit.models.types.LiteralType(simple=None, schema=None, collection_type=None, map_value_type=None, blob=None, metadata=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

property blob
Return type

flytekit.models.core.types.BlobType

property collection_type

Enum type from SimpleType or SchemaType :rtype: LiteralType

classmethod from_flyte_idl(proto)[source]
Parameters

proto (flyteidl.core.types_pb2.LiteralType) –

Return type

LiteralType

property map_value_type

Enum type from SimpleType :rtype: LiteralType

property metadata
Return type

dict[Text, T]

property schema

Type definition for a dataframe-like object. :rtype: SchemaType

property simple

Enum type from SimpleType :rtype: int

to_flyte_idl()[source]
Return type

flyteidl.core.types_pb2.LiteralType

class flytekit.models.types.OutputReference(node_id, var)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]
Parameters

pb2_object (flyteidl.core.types.OutputReference) –

Return type

OutputReference

property node_id

Node id must exist at the graph layer. :rtype: Text

to_flyte_idl()[source]
Return type

flyteidl.core.types.OutputReference

property var

Variable name must refer to an output variable for the node. :rtype: Text

class flytekit.models.types.SchemaType(columns)[source]

Bases: flytekit.models.common.FlyteIdlEntity

class SchemaColumn(name, type)[source]

Bases: flytekit.models.common.FlyteIdlEntity

class SchemaColumnType[source]

Bases: object

BOOLEAN = 3
DATETIME = 4
DURATION = 5
FLOAT = 1
INTEGER = 0
STRING = 2
classmethod from_flyte_idl(proto)[source]
Parameters

proto (flyteidl.core.types_pb2.SchemaType.SchemaColumn) –

Return type

SchemaType.SchemaColumn

property name

Name for the column :rtype: Text

to_flyte_idl()[source]
Return type

flyteidl.core.types_pb2.SchemaType.SchemaColumn

property type

Enum type from SchemaType.SchemaColumn.SchemaColumnType representing the type of the column :rtype: int

property columns

A list of columns defining the underlying data frame. :rtype: list[SchemaType.SchemaColumn]

classmethod from_flyte_idl(proto)[source]
Parameters

proto (flyteidl.core.types_pb2.SchemaType) –

Return type

SchemaType

to_flyte_idl()[source]
Return type

flyteidl.core.types_pb2.SchemaType

class flytekit.models.types.SimpleType[source]

Bases: object

BINARY = 7
BOOLEAN = 4
DATETIME = 5
DURATION = 6
ERROR = 8
FLOAT = 2
INTEGER = 1
NONE = 0
STRING = 3
STRUCT = 9

flytekit.models.workflow_closure module

class flytekit.models.workflow_closure.WorkflowClosure(workflow, tasks=None)[source]

Bases: flytekit.models.common.FlyteIdlEntity

classmethod from_flyte_idl(pb2_object)[source]

:param flyteidl.core.workflow_closure_pb2.WorkflowClosure pb2_object :rtype: WorkflowClosure

property tasks
Return type

list[flytekit.models.task.TaskTemplate]

to_flyte_idl()[source]
Return type

flyteidl.core.workflow_closure_pb2.WorkflowClosure

property workflow
Return type

flytekit.models.core.workflow.WorkflowTemplate

Module contents