cursus.validation.alignment.config.step_type_specific_rules

Step-Type-Specific Builder Validation Rules

This module defines validation rules specific to different SageMaker step types. Each step type has unique methods and requirements beyond the universal builder interface.

Based on analysis of actual step builders in the cursus codebase.

class StepTypeCategory(*values)[source]

Bases: Enum

Categories of step types based on their validation requirements.

SCRIPT_BASED = 'script_based'
CONTRACT_BASED = 'contract_based'
NON_SCRIPT = 'non_script'
CONFIG_ONLY = 'config_only'
EXCLUDED = 'excluded'
get_step_type_validation_rules()[source]

Get all step-type-specific validation rules.

Returns:

Dictionary containing all step-type-specific validation rules

Return type:

Dict[str, Any]

get_validation_rules_for_step_type(step_type)[source]

Get validation rules for a specific step type.

Parameters:

step_type (str) – The SageMaker step type (e.g., “Training”, “Processing”)

Returns:

Dictionary of validation rules for the step type, or None if not found

Return type:

Dict[str, Any] | None

get_required_methods_for_step_type(step_type)[source]

Get required methods for a specific step type.

Parameters:

step_type (str) – The SageMaker step type

Returns:

Dictionary of required methods, empty if step type not found

Return type:

Dict[str, Any]

get_optional_methods_for_step_type(step_type)[source]

Get optional methods for a specific step type.

Parameters:

step_type (str) – The SageMaker step type

Returns:

Dictionary of optional methods, empty if step type not found

Return type:

Dict[str, Any]

get_all_methods_for_step_type(step_type)[source]

Get all methods (required + optional) for a specific step type.

Parameters:

step_type (str) – The SageMaker step type

Returns:

Dictionary combining required and optional methods

Return type:

Dict[str, Any]

get_step_types_by_category(category)[source]

Get all step types in a specific category.

Parameters:

category (StepTypeCategory) – The step type category

Returns:

List of step type names in the category

Return type:

List[str]

is_step_type_excluded(step_type)[source]

Check if a step type is excluded from validation.

Parameters:

step_type (str) – The SageMaker step type

Returns:

True if step type is excluded, False otherwise

Return type:

bool

get_step_type_category(step_type)[source]

Get the category for a step type.

Parameters:

step_type (str) – The SageMaker step type

Returns:

StepTypeCategory enum value, or None if step type not found

Return type:

StepTypeCategory | None

validate_step_type_compliance(builder_class, step_type)[source]

Validate that a builder class complies with step-type-specific rules.

Parameters:
  • builder_class (type) – The builder class to validate

  • step_type (str) – The SageMaker step type

Returns:

List of validation issues (empty if compliant)

Return type:

List[str]

get_validation_summary()[source]

Get a summary of all step types and their validation requirements.

Returns:

Dictionary with validation summary statistics

Return type:

Dict[str, Any]