Skip to content

chore(codestyle): fix black formatting and unused import - #6394

Merged
rsareddy0329 merged 1 commit into
aws:masterfrom
rsareddy0329:fix/codestyle-black-flake8-master
Oct 9, 2026
Merged

rsareddy0329 merged 1 commit into
aws:masterfrom
rsareddy0329:fix/codestyle-black-flake8-master

Conversation

@rsareddy0329

Copy link
Copy Markdown
Contributor

Issue

The codestyle-doc-tests PR check is failing on master for sagemaker-core, sagemaker-mlops, and sagemaker-train (sagemaker-serve passes). The failures were introduced by earlier commits that landed .py files without running black, plus one unused import.

Reproduced on latest master with the CI-pinned tools (black==26.3.1, flake8==7.1.2):

  • sagemaker-core — black-check: 5 files (workflow/job_config_document.py, workflow/pipeline_capture.py, and 3 tests/unit/workflow/ tests)
  • sagemaker-mlops — black-check: 3 files (workflow/steps.py, tests/integ/workflow/test_job_step_mtrl.py, tests/unit/workflow/test_job_step.py)
  • sagemaker-train — black-check: tests/unit/train/test_multi_turn_rl_trainer.py, and flake8 F401 (unused unittest.mock.PropertyMock) in the same file

The CI build log confirms flake8, pylint, docstyle, twine otherwise succeeded; only black-check (and the train F401) failed.

Description of changes

  • Ran black (line-length 100) on the unformatted files in all three packages.
  • Removed the unused PropertyMock import in test_multi_turn_rl_trainer.py.

Formatting-only (black preserves the AST); the sole semantic change is the unused-import removal.

Testing done

With the CI-pinned tools, in each of the three packages:

  • black --check ./ → 0 files would be reformatted
  • flake8 → rc 0
  • pydocstyle src/sagemaker → rc 0

Merge Checklist

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change (N/A — no client changes)
  • I have updated any necessary documentation (N/A — formatting only)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Apply black (26.3.1, line-length 100) to files that were committed
unformatted, and remove an unused import, fixing the failing
codestyle-doc-tests (black-check + flake8) on sagemaker-core,
sagemaker-mlops, and sagemaker-train.

- sagemaker-core: reformat workflow/job_config_document.py,
  workflow/pipeline_capture.py and three workflow unit tests.
- sagemaker-mlops: reformat workflow/steps.py and two workflow tests.
- sagemaker-train: reformat test_multi_turn_rl_trainer.py and drop the
  unused unittest.mock.PropertyMock import (flake8 F401).

Formatting-only (black preserves the AST); the sole semantic change is
the removal of the unused import.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI code review

This PR applies black formatting to several previously-unformatted .py files across sagemaker-core, sagemaker-mlops, and sagemaker-train, and removes an unused PropertyMock import to fix a flake8 F401 error. The changes are formatting-only (AST-preserving) plus the single unused-import removal, which I confirmed is unused elsewhere in the file. No issues found.

Reviewed commit 2a3cf98. Automated review; verify before acting.

@rsareddy0329
rsareddy0329 merged commit e449c7f into aws:master Oct 9, 2026
30 of 34 checks passed

This branch was previously deployed

1 inactive deployment
auto-approve — 2a3cf984 Deployed Oct 8, 2026 by rsareddy0329 via wait-for-approval #564
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.

3 participants