Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`QualityCheckStep` misplaces the output KMS key and omits tags

オープン 初心者向け
#6,495 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
aws, python

調査の方向性

QualityCheckStep の arguments メソッド(sagemaker.mlops.workflow.quality_check_step 内)から始めてください。ここで処理ジョブのリクエスト辞書が構築されます。KmsKeyId を S3 出力の辞書から ProcessingOutputConfig に移動し、check_job_config の Tags をリクエストに追加します。Issue の再現スクリプトを print(step.arguments) 付きで実行し、KmsKeyId が ProcessingOutputConfig にあり、出力に Tags が表示されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

PySDK Version

  • PySDK V2 (2.x)
  • PySDK V3 (3.x)

Describe the bug

QualityCheckStep.arguments builds a processing-job request manually.

The method puts KmsKeyId inside ProcessingS3Output. The SageMaker API
requires this field on ProcessingOutputConfig.

The method also omits the tags from CheckJobConfig.

The generated request has this incorrect structure:

{
  "ProcessingOutputConfig": {
    "Outputs": [
      {
        "S3Output": {
          "KmsKeyId": "arn:aws:kms:..."
        }
      }
    ]
  }
}

This behavior is present in SageMaker Python SDK v3.25.0.

To reproduce

Set these environment variables:

export AWS_REGION="us-east-2"
export SAGEMAKER_ROLE_ARN="arn:aws:iam::<account-id>:role/<sagemaker-execution-role>"
export KMS_KEY_ARN="arn:aws:kms:us-east-2:<account-id>:key/<key-id>"

Run this script:

import os

import boto3
from sagemaker.core.workflow.pipeline_context import PipelineSession
from sagemaker.mlops.workflow.check_job_config import CheckJobConfig
from sagemaker.mlops.workflow.quality_check_step import (
    DataQualityCheckConfig,
    QualityCheckStep,
)

session = PipelineSession(
    boto_session=boto3.Session(region_name=os.environ["AWS_REGION"])
)
job_config = CheckJobConfig(
    role=os.environ["SAGEMAKER_ROLE_ARN"],
    instance_type="ml.m5.xlarge",
    instance_count=1,
    output_kms_key=os.environ["KMS_KEY_ARN"],
    tags=[{"Key": "test", "Value": "quality-check"}],
    sagemaker_session=session,
)
quality_config = DataQualityCheckConfig(
    baseline_dataset="s3://example-bucket/baseline.csv",
    dataset_format={"csv": {"header": True}},
    output_s3_uri="s3://example-bucket/baseline-output/",
)
step = QualityCheckStep(
    name="quality-check-reproduction",
    quality_check_config=quality_config,
    check_job_config=job_config,
    register_new_baseline=True,
    skip_check=True,
)

print(step.arguments)

The output contains ProcessingOutputConfig.Outputs[0].S3Output.KmsKeyId.
The output does not contain Tags.

Expected behavior

The request must put the KMS key on ProcessingOutputConfig:

{
  "ProcessingOutputConfig": {
    "KmsKeyId": "arn:aws:kms:...",
    "Outputs": []
  },
  "Tags": [
    {"Key": "test", "Value": "quality-check"}
  ]
}

Screenshots or logs

The v3.25 implementation contains:

if self.check_job_config.output_kms_key:
    s3_output_dict["KmsKeyId"] = self.check_job_config.output_kms_key

The request builder does not read self.check_job_config.tags.

System information

  • SageMaker Python SDK version: 3.25.0
  • Framework name (eg. PyTorch) or algorithm (eg. KMeans): SageMaker Model Monitor
  • Framework version: Not applicable
  • Python version: 3.12
  • CPU or GPU: CPU
  • Custom Docker image (Y/N): No

Additional context

A temporary QualityCheckStep subclass can correct the request. The workaround
moves KmsKeyId to ProcessingOutputConfig and adds the configured tags.

A possible fix is:

processing_output_config = {"Outputs": processing_outputs}
if self.check_job_config.output_kms_key:
    processing_output_config["KmsKeyId"] = self.check_job_config.output_kms_key

request_dict["ProcessingOutputConfig"] = processing_output_config
if self.check_job_config.tags:
    request_dict["Tags"] = self.check_job_config.tags
主要言語
Python
スター
2.3k
フォーク
1.3k
平均マージ
2日 20時間
マージ済み PR(30日)
85

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/sagemaker-python-sdk のほかの issue

aws/sagemaker-python-sdk の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。