flytekit.ExecutionParameters

class flytekit.ExecutionParameters(execution_date, tmp_dir, stats, execution_id, logging, raw_output_prefix, output_metadata_prefix=None, checkpoint=None, decks=None, task_id=None, **kwargs)[source]

This is a run-time user-centric context object that is accessible to every @task method. It can be accessed using

flytekit.current_context()

This object provides the following * a statsd handler * a logging handler * the execution ID as an flytekit.models.core.identifier.WorkflowExecutionIdentifier object * a working directory for the user to write arbitrary files to

Please do not confuse this object with the flytekit.FlyteContext object.

Methods

Parameters:
  • execution_id (Optional[_identifier.WorkflowExecutionIdentifier])

  • task_id (Optional[_identifier.Identifier])

builder()[source]
Return type:

Builder

get(key)[source]

Returns task specific context if present else raise an error. The returned context will match the key

Parameters:

key (str)

Return type:

Any

has_attr(attr_name)[source]
Parameters:

attr_name (str)

Return type:

bool

static new_builder(current=None)[source]
Parameters:

current (Optional[ExecutionParameters])

Return type:

Builder

with_task_sandbox()[source]
Return type:

Builder

Attributes

checkpoint
decks

A list of decks of the tasks, and it will be rendered to a html at the end of the task execution.

default_deck
execution_date

This is a datetime representing the time at which a workflow was started. This is consistent across all tasks executed in a workflow or sub-workflow.

Note

Do NOT use this execution_date to drive any production logic. It might be useful as a tag for data to help in debugging.

execution_id

This is the identifier of the workflow execution within the underlying engine. It will be consistent across all task executions in a workflow or sub-workflow execution.

Note

Do NOT use this execution_id to drive any production logic. This execution ID should only be used as a tag on output data to link back to the workflow run that created it.

logging

A handle to a useful logging object. TODO: Usage examples

output_metadata_prefix
raw_output_prefix
secrets
stats

A handle to a special statsd object that provides usefully tagged stats. TODO: Usage examples and better comments

task_id

At production run-time, this will be generated by reading environment variables that are set by the backend.

timeline_deck
working_directory

A handle to a special working directory for easily producing temporary files. TODO: Usage examples