flytekit.engines.unit package

Submodules

flytekit.engines.unit.engine module

class flytekit.engines.unit.engine.DynamicTask(*args, **kwargs)[source]

Bases: flytekit.engines.unit.engine.ReturnOutputsTask

static execute_array_task(root_input_path, task, array_inputs)[source]
static fulfil_bindings(binding_data, fulfilled_promises)[source]

Substitutes promise values in binding_data with model Literal values built from python std values in fulfilled_promises

Parameters
  • binding_data (_interface.BindingData) –

  • fulfilled_promises (dict[Text,T]) –

Return type

property has_workflow_node
Return type

bool

class flytekit.engines.unit.engine.HiveTask(*args, **kwargs)[source]

Bases: flytekit.engines.unit.engine.DynamicTask

class flytekit.engines.unit.engine.ReturnOutputsTask(sdk_task)[source]

Bases: flytekit.engines.unit.engine.UnitTestEngineTask

class flytekit.engines.unit.engine.UnitTestEngineFactory[source]

Bases: flytekit.engines.common.BaseExecutionEngineFactory

fetch_latest_task(named_task)[source]

Fetches the latest task :param flytekit.models.common.NamedEntityIdentifier named_task: NamedEntityIdentifier to fetch :rtype: flytekit.models.task.Task

fetch_launch_plan(_)[source]
fetch_task(_)[source]
Parameters

task_id (flytekit.models.core.identifier.Identifier) – This identifier should have a resource type of kind Task.

Return type

flytekit.models.task.Task

fetch_workflow(_)[source]
fetch_workflow_execution(_)[source]
Parameters

wf_exec_id (flytekit.models.core.identifier.WorkflowExecutionIdentifier) –

Return type

flytekit.models.execution.Execution

get_launch_plan(_)[source]
Parameters

sdk_launch_plan (flytekit.common.launch_plan.SdkLaunchPlan) –

Return type

BaseLaunchPlanLauncher

get_node_execution(_)[source]
Parameters

node_exec (flytekit.common.nodes.SdkNodeExecution) –

Return type

BaseNodeExecution

get_task(sdk_task)[source]
Parameters

sdk_task (flytekit.common.tasks.task.SdkTask) –

Return type

UnitTestEngineTask

get_task_execution(_)[source]
Parameters

task_exec (flytekit.common.tasks.executions.SdkTaskExecution) –

Return type

BaseTaskExecution

get_workflow(_)[source]
get_workflow_execution(_)[source]
Parameters

wf_exec (flytekit.common.workflow_execution.SdkWorkflowExecution) –

Return type

BaseWorkflowExecution

class flytekit.engines.unit.engine.UnitTestEngineTask(sdk_task)[source]

Bases: flytekit.engines.common.BaseTaskExecutor

execute(inputs, context=None)[source]

Just execute the function and return the outputs as a user-readable dictionary. :param flytekit.models.literals.LiteralMap inputs: :param context: :rtype: dict[Text,flytekit.models.common.FlyteIdlEntity]

launch(project, domain, name=None, inputs=None, notification_overrides=None, label_overrides=None, annotation_overrides=None, auth_role=None)[source]

Executes the task as a single task execution and returns the identifier. :param Text project: :param Text domain: :param Text name: :param flytekit.models.literals.LiteralMap inputs: The inputs to pass :param list[flytekit.models.common.Notification] notification_overrides: If specified, override the

notifications.

Parameters
Return type

flytekit.models.execution.Execution

register(identifier, version)[source]

Registers the task :param flytekit.models.core.identifier.Identifier identifier:

flytekit.engines.unit.mock_stats module

class flytekit.engines.unit.mock_stats.MockStats(scope='', tags=None)[source]

Bases: object

current_tags(metric)[source]
current_value(metric)[source]
decr(metric, count=1, tags=None, **kwargs)[source]
gauge(metric, value, tags=None, **kwargs)[source]
incr(metric, count=1, tags=None, **kwargs)[source]
timer(metric, tags=None, **kwargs)[source]
timing(metric)[source]

Module contents