sagemaker.core.workflow.conditions#

Conditions for condition steps.

Ideally, some of these comparison conditions would be implemented as “partial classes”, but use of functools.partial doesn’t set correct metadata/type information.

Functions

primitive_or_expr(value)

Provide the expression of the value or return value if it is a primitive.

Classes

Condition([condition_type])

Abstract Condition entity.

ConditionComparison([condition_type, left, ...])

Generic comparison condition that can be used to derive specific condition comparisons.

ConditionEquals(left, right)

A condition for equality comparisons.

ConditionGreaterThan(left, right)

A condition for greater than comparisons.

ConditionGreaterThanOrEqualTo(left, right)

A condition for greater than or equal to comparisons.

ConditionIn(value, in_values)

A condition to check membership.

ConditionLessThan(left, right)

A condition for less than comparisons.

ConditionLessThanOrEqualTo(left, right)

A condition for less than or equal to comparisons.

ConditionNot(expression)

A condition for negating another Condition.

ConditionOr([conditions])

A condition for taking the logical OR of a list of Condition instances.

ConditionTypeEnum(*args[, value])

Condition type enum.

class sagemaker.core.workflow.conditions.Condition(condition_type: ConditionTypeEnum = NOTHING)[source]#

Bases: Entity

Abstract Condition entity.

condition_type#

The type of condition.

Type:

ConditionTypeEnum

condition_type: ConditionTypeEnum#
class sagemaker.core.workflow.conditions.ConditionComparison(condition_type: ConditionTypeEnum = NOTHING, left: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None = None, right: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None = None)[source]#

Bases: Condition

Generic comparison condition that can be used to derive specific condition comparisons.

left#

The execution variable, parameter, property, step output or Python primitive value to use in the comparison.

Type:

Union[ConditionValueType, PrimitiveType]

right#

The execution variable, parameter, property, step output or Python primitive value to compare to.

Type:

Union[ConditionValueType, PrimitiveType]

condition_type: ConditionTypeEnum#
left: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None#
right: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None#
to_request() Dict[str, Any] | List[Dict[str, Any]][source]#

Get the request structure for workflow service calls.

class sagemaker.core.workflow.conditions.ConditionEquals(left: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None, right: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None)[source]#

Bases: ConditionComparison

A condition for equality comparisons.

class sagemaker.core.workflow.conditions.ConditionGreaterThan(left: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None, right: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None)[source]#

Bases: ConditionComparison

A condition for greater than comparisons.

class sagemaker.core.workflow.conditions.ConditionGreaterThanOrEqualTo(left: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None, right: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None)[source]#

Bases: ConditionComparison

A condition for greater than or equal to comparisons.

class sagemaker.core.workflow.conditions.ConditionIn(value: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None, in_values: List[ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None])[source]#

Bases: Condition

A condition to check membership.

to_request() Dict[str, Any] | List[Dict[str, Any]][source]#

Get the request structure for workflow service calls.

class sagemaker.core.workflow.conditions.ConditionLessThan(left: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None, right: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None)[source]#

Bases: ConditionComparison

A condition for less than comparisons.

class sagemaker.core.workflow.conditions.ConditionLessThanOrEqualTo(left: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None, right: ExecutionVariable | Parameter | Properties | StepOutput | str | int | bool | float | None)[source]#

Bases: ConditionComparison

A condition for less than or equal to comparisons.

class sagemaker.core.workflow.conditions.ConditionNot(expression: Condition)[source]#

Bases: Condition

A condition for negating another Condition.

to_request() Dict[str, Any] | List[Dict[str, Any]][source]#

Get the request structure for workflow service calls.

class sagemaker.core.workflow.conditions.ConditionOr(conditions: List[Condition] | None = None)[source]#

Bases: Condition

A condition for taking the logical OR of a list of Condition instances.

to_request() Dict[str, Any] | List[Dict[str, Any]][source]#

Get the request structure for workflow service calls.

class sagemaker.core.workflow.conditions.ConditionTypeEnum(*args, value=<object object>, **kwargs)[source]#

Bases: Enum

Condition type enum.

EQ = 'Equals'#
GT = 'GreaterThan'#
GTE = 'GreaterThanOrEqualTo'#
IN = 'In'#
LT = 'LessThan'#
LTE = 'LessThanOrEqualTo'#
NOT = 'Not'#
OR = 'Or'#
sagemaker.core.workflow.conditions.primitive_or_expr(value: ExecutionVariable | PipelineVariable | str | int | bool | float | None | Parameter | Properties | StepOutput) Dict[str, str] | str | int | bool | float | None[source]#

Provide the expression of the value or return value if it is a primitive.

Parameters:

value (Union[ConditionValueType, PrimitiveType]) – The value to evaluate.

Returns:

Either the expression of the value or the primitive value.