in src/sagemaker/workflow/quality_check_step.py [0:0]
def _generate_baseline_job_inputs(self):
"""Generates a dict with ProcessingInput objects
Generates a dict with three ProcessingInput objects: baseline_dataset_input,
post_processor_script_input and record_preprocessor_script_input
Returns:
dict: with three ProcessingInput objects as baseline job inputs
"""
baseline_dataset = self.quality_check_config.baseline_dataset
baseline_dataset_des = str(
pathlib.PurePosixPath(
_CONTAINER_BASE_PATH, _CONTAINER_INPUT_PATH, _BASELINE_DATASET_INPUT_NAME
)
)
if isinstance(baseline_dataset, (ExecutionVariable, Expression, Parameter, Properties)):
baseline_dataset_input = ProcessingInput(
source=self.quality_check_config.baseline_dataset,
destination=baseline_dataset_des,
input_name=_BASELINE_DATASET_INPUT_NAME,
)
else:
baseline_dataset_input = self._model_monitor._upload_and_convert_to_processing_input(
source=self.quality_check_config.baseline_dataset,
destination=baseline_dataset_des,
name=_BASELINE_DATASET_INPUT_NAME,
)
post_processor_script_input = self._model_monitor._upload_and_convert_to_processing_input(
source=self.quality_check_config.post_analytics_processor_script,
destination=str(
pathlib.PurePosixPath(
_CONTAINER_BASE_PATH,
_CONTAINER_INPUT_PATH,
_POST_ANALYTICS_PROCESSOR_SCRIPT_INPUT_NAME,
)
),
name=_POST_ANALYTICS_PROCESSOR_SCRIPT_INPUT_NAME,
)
record_preprocessor_script_input = None
if isinstance(self.quality_check_config, DataQualityCheckConfig):
record_preprocessor_script_input = (
self._model_monitor._upload_and_convert_to_processing_input(
source=self.quality_check_config.record_preprocessor_script,
destination=str(
pathlib.PurePosixPath(
_CONTAINER_BASE_PATH,
_CONTAINER_INPUT_PATH,
_RECORD_PREPROCESSOR_SCRIPT_INPUT_NAME,
)
),
name=_RECORD_PREPROCESSOR_SCRIPT_INPUT_NAME,
)
)
return dict(
baseline_dataset_input=baseline_dataset_input,
post_processor_script_input=post_processor_script_input,
record_preprocessor_script_input=record_preprocessor_script_input,
)