Skip to content

fix(mlops): serialize NetworkConfig and keep S3 input fields in check step requests - #6406

Open
AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/check-step-network-config
Open

AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/check-step-network-config

Conversation

@AkshayShah03

@AkshayShah03 AkshayShah03 commented Oct 9, 2026 •

Copy link
Copy Markdown

Issue #, if available: N/A (now also covers #6421, which I'm closing in favour of this PR)

Description of changes:

Rebased onto master after #6497, which moved the QualityCheckStep / ClarifyCheckStep request building into the shared _check_job_request._build_check_job_request. Both fixes now go into that helper:

  1. NetworkConfig is put into the request as an object. CheckJobConfig.network_config is a sagemaker.core.network.NetworkConfig, and the helper put that object itself in the request. Any check step with a network config (VPC, network isolation) produces arguments that aren't JSON serializable, so pipeline.definition(), create() and upsert() fail with TypeError: Object of type NetworkConfig is not JSON serializable. The helper now sends network_config._to_request_dict(), as the core Processor does. A plain dict is passed through unchanged.
  2. S3CompressionType and S3DataDistributionType are dropped from the processing inputs. With DataConfig(s3_compression_type="Gzip") in a ClarifyCheckStep, the job ran without S3CompressionType, so the gzipped dataset reached the Clarify container still compressed. Both fields are now kept when set; None and unassigned values are skipped.

Testing:

  • New tests in test_check_job_request.py:
    • a real NetworkConfig is serialized, and the request passes json.dumps and validates against botocore's CreateProcessingJob input shape;
    • the compression and distribution fields are kept.
  • Both fail on master.
  • sagemaker-mlops/tests/unit: 983 passed (981 on master). The 28 feature_processor collection errors also happen on master.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

… step requests

The shared check-step request builder (_build_check_job_request, used by
QualityCheckStep and ClarifyCheckStep) had two gaps:

- It put the processor's NetworkConfig object straight into the request.
  CheckJobConfig.network_config is a sagemaker.core.network.NetworkConfig, so
  any check step with a network config (VPC, network isolation) produced
  arguments that are not JSON serializable, and pipeline.definition()/create()/
  upsert() failed with 'Object of type NetworkConfig is not JSON serializable'.
  Send its request dict, as the core Processor does.
- It serialized only S3Uri, LocalPath, S3DataType and S3InputMode for each
  input, dropping S3CompressionType and S3DataDistributionType. A
  DataConfig(s3_compression_type='Gzip') in a ClarifyCheckStep therefore
  produced a job without S3CompressionType, so the gzipped dataset reached the
  container still compressed. Keep both fields when they are set.
@AkshayShah03
AkshayShah03 force-pushed the fix/check-step-network-config branch from e15fb38 to 37b1784 Compare November 9, 2026 03:44
@AkshayShah03 AkshayShah03 changed the title fix(mlops): serialize NetworkConfig in QualityCheckStep and ClarifyCheckStep fix(mlops): serialize NetworkConfig and keep S3 input fields in check step requests Nov 9, 2026

This branch is waiting to be deployed

1 waiting deployment
manual-approval — 37b17845 Waiting Nov 9, 2026 by AkshayShah03 via wait-for-approval #2193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant