flytekit.ExecutionParameters

class flytekit.ExecutionParameters(execution_date, tmp_dir, stats, execution_id, logging, **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.

Parameters
  • execution_date – Date when the execution is running

  • tmp_dir – temporary directory for the execution

  • stats – handle to emit stats

  • execution_id – Identifier for the xecution

  • logging – handle to logging

Methods

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 (ExecutionParameters) –

Return type

Builder

Attributes

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

secrets
stats

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

working_directory

A handle to a special working directory for easily producing temporary files.

TODO: Usage examples TODO: This does not always return a AutoDeletingTempDir