Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,15 @@ def arguments(self) -> RequestType:
"S3DataType": getattr(inp.s3_input, "s3_data_type", "S3Prefix"),
"S3InputMode": getattr(inp.s3_input, "s3_input_mode", "File"),
}
# Optional fields, e.g. DataConfig(s3_compression_type="Gzip"); skip unset
# (None/Unassigned) values.
for api_key, attr in (
("S3DataDistributionType", "s3_data_distribution_type"),
("S3CompressionType", "s3_compression_type"),
):
value = getattr(inp.s3_input, attr, None)
if isinstance(value, str):
input_dict["S3Input"][api_key] = value
processing_inputs.append(input_dict)

s3_output_dict = {
Expand Down
20 changes: 20 additions & 0 deletions sagemaker-mlops/tests/unit/workflow/test_clarify_check_step_kms.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,26 @@ def _create_mock_clarify_check_step(output_kms_key=None, volume_kms_key=None):
return step


class TestClarifyCheckStepDatasetInput:
"""Tests for the dataset ProcessingInput in ClarifyCheckStep.arguments."""

@patch(_TRIM_PATCH, side_effect=_noop_trim)
def test_dataset_compression_and_distribution_type_propagated(self, mock_trim):
"""S3CompressionType/S3DataDistributionType from DataConfig must reach the request."""
step = _create_mock_clarify_check_step()
data_s3_input = step._processing_params["data_input"].s3_input
data_s3_input.s3_compression_type = "Gzip"
data_s3_input.s3_data_distribution_type = "ShardedByS3Key"

args = step.arguments

dataset_input = next(
inp for inp in args["ProcessingInputs"] if inp["InputName"] == "dataset"
)
assert dataset_input["S3Input"]["S3CompressionType"] == "Gzip"
assert dataset_input["S3Input"]["S3DataDistributionType"] == "ShardedByS3Key"


class TestClarifyCheckStepKmsKeyPropagation:
"""Tests for KMS key propagation in ClarifyCheckStep.arguments."""

Expand Down
Loading