cursus.steps.configs.config_temporal_split_preprocessing_step

Temporal Split Preprocessing Configuration with Self-Contained Derivation Logic

This module implements the configuration class for SageMaker Processing steps for temporal split preprocessing, using a self-contained design where each field is properly categorized according to the three-tier design: 1. Essential User Inputs (Tier 1) - Required fields that must be provided by users 2. System Fields (Tier 2) - Fields with reasonable defaults that can be overridden 3. Derived Fields (Tier 3) - Fields calculated from other fields, private with read-only properties

class TemporalSplitPreprocessingConfig(*, author, bucket, role, region, service_name, pipeline_version, model_class='xgboost', current_date=<factory>, framework_version='2.1.0', py_version='py310', source_dir=None, enable_caching=False, use_secure_pypi=False, max_runtime_seconds=172800, project_root_folder, processing_instance_count=1, processing_volume_size=500, processing_instance_type_large='ml.m5.4xlarge', processing_instance_type_small='ml.m5.2xlarge', use_large_processing_instance=False, skip_volume_kms=None, processing_source_dir=None, processing_entry_point='temporal_split_preprocessing.py', processing_script_arguments=None, processing_framework_version='1.2-1', job_type, date_column, group_id_column, split_date, train_ratio=0.9, random_seed=42, output_format='CSV', max_workers=4, batch_size=10, enable_true_streaming=False, label_field=None, targets=None, main_task_index=0, **extra_data)[source]

Bases: ProcessingStepConfigBase

Configuration for the Temporal Split Preprocessing step with three-tier field categorization. Inherits from ProcessingStepConfigBase.

Fields are categorized into: - Tier 1: Essential User Inputs - Required from users - Tier 2: System Fields - Default values that can be overridden - Tier 3: Derived Fields - Private with read-only property access

job_type: str
date_column: str
group_id_column: str
split_date: str
processing_entry_point: str
train_ratio: float
random_seed: int
output_format: str
max_workers: int | None
batch_size: int
enable_true_streaming: bool
label_field: str | None
targets: List[str] | None
main_task_index: int | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'allow', 'protected_namespaces': (), 'validate_assignment': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

property full_script_path: str | None

Get full path to the temporal split preprocessing script.

Returns:

Full path to the script

get_environment_variables(declared_env_vars=None)[source]

Temporal-split env vars (the single env source; FZ 31e1d3g). Delegates to the temporal_split_environment_variables property; declared_env_vars is accepted for the builder’s names-driven contract but ignored (the property already produces the full set).

property temporal_split_environment_variables: Dict[str, str]

Get temporal split preprocessing-specific environment variables.

Returns:

Dictionary mapping environment variable names to values

classmethod validate_entry_point_relative(v)[source]

Ensure processing_entry_point is a non‐empty relative path.

classmethod validate_job_type(v)[source]

Ensure job_type is one of the allowed values.

classmethod validate_split_date_format(v)[source]

Ensure split_date is in YYYY-MM-DD format.

classmethod validate_train_ratio(v)[source]

Ensure the train_ratio is between 0 and 1.

classmethod validate_output_format(v)[source]

Ensure output_format is one of the allowed values (case-insensitive).

Matching is case-insensitive and the stored value is normalized to the canonical-cased allowed value, so the persisted config never drifts.

classmethod validate_targets_list(v)[source]

Validate targets is a list of strings for multitask mode.

validate_task_configuration()[source]

Validate single-task vs multitask configuration.

Design: - Single-task mode: label_field MUST be provided - Multitask mode: targets AND main_task_index MUST be provided - For non-training job types (validation, testing, calibration): both are optional

initialize_derived_fields()[source]

Initialize all derived fields once after validation.

get_public_init_fields()[source]

Override get_public_init_fields to include temporal split preprocessing specific fields.

Returns:

Dictionary of field names to values for child initialization

Return type:

Dict[str, Any]

model_dump(**kwargs)[source]

Override model_dump to include derived properties.

get_job_arguments()[source]

CLI args — config is the single source (FZ 31e1d3h).

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self (BaseModel) – The BaseModel instance.

  • context (Any) – The context.