Skip to content

fix: Pipeline TypeError: can only concatenate list (not "NoneType") to list Using Sou (#5518)#5680

Closed
aviruthen wants to merge 1 commit intoaws:masterfrom
aviruthen:fix/pipeline-typeerror-can-only-concatenate-list-not-5518-3
Closed

fix: Pipeline TypeError: can only concatenate list (not "NoneType") to list Using Sou (#5518)#5680
aviruthen wants to merge 1 commit intoaws:masterfrom
aviruthen:fix/pipeline-typeerror-can-only-concatenate-list-not-5518-3

Conversation

@aviruthen
Copy link
Copy Markdown
Collaborator

Description

The bug is a TypeError in get_code_hash() when SourceCode.requirements is None (the default). In v3.3.1 (the user's version), get_training_code_hash() did [source_dir] + dependencies where dependencies was None, causing TypeError: can only concatenate list (not 'NoneType') to list. The current master code in sagemaker-core/src/sagemaker/core/workflow/utilities.py has already been partially fixed — get_training_code_hash() now checks if dependencies: before concatenation. However, there is no test coverage for get_code_hash() being called with a TrainingStep whose SourceCode has requirements=None. Additionally, the get_code_hash() function itself could be more defensive by normalizing None requirements before passing them downstream. The fix on master looks correct but test coverage should be added to prevent regression.

Related Issue

Fixes #5518

Changes Made

  • sagemaker-core/src/sagemaker/core/workflow/utilities.py
  • sagemaker-core/tests/unit/workflow/test_utilities.py

AI-Generated PR

This PR was automatically generated by the PySDK Issue Agent.

  • Confidence score: 85%
  • Classification: bug
  • SDK version target: V3

Merge Checklist

  • Changes are backward compatible
  • Commit message follows prefix: description format
  • Unit tests added/updated
  • Integration tests added (if applicable)
  • Documentation updated (if applicable)

@aviruthen aviruthen closed this Mar 26, 2026
@aviruthen aviruthen deleted the fix/pipeline-typeerror-can-only-concatenate-list-not-5518-3 branch March 26, 2026 17:15
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.

Pipeline TypeError: can only concatenate list (not "NoneType") to list Using SourceCode

1 participant