Skip to content

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

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)#5678
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 occurs in get_code_hash() -> get_training_code_hash() in sagemaker-core/src/sagemaker/core/workflow/utilities.py. When a SourceCode object is created without specifying requirements (which defaults to None), the get_code_hash() function reads source_code.requirements (which is None) and passes it as the dependencies parameter to get_training_code_hash(). In the user's installed version (3.3.1), the function directly does [source_dir] + dependencies where dependencies is None, causing TypeError: can only concatenate list (not "NoneType") to list. The fix already exists in the current repo HEAD: the get_training_code_hash() function now guards against None dependencies by checking if dependencies: before concatenation, and wraps the single string value in a list [dependencies] rather than expecting it to already be a list. This is a valid fix since SourceCode.requirements is Optional[StrPipeVar] (a single string path, not a list). No additional changes are needed beyond what's already in the repo.

Related Issue

Fixes #5518

Changes Made

  • 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 16:34
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