Skip to content

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

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)#5676
aviruthen wants to merge 1 commit intoaws:masterfrom
aviruthen:fix/pipeline-typeerror-can-only-concatenate-list-not-5518-3

Conversation

@aviruthen
Copy link
Collaborator

Description

The bug is a TypeError in get_training_code_hash() in sagemaker-core/src/sagemaker/core/workflow/utilities.py. When a user creates a SourceCode object without specifying requirements (which defaults to None), and then uses it in a Pipeline with pipeline.upsert(), the code path get_code_hash() -> get_training_code_hash() attempts to concatenate [source_dir] + dependencies where dependencies is None, causing TypeError: can only concatenate list (not 'NoneType') to list. The fix is already present in the current codebase on master: the get_training_code_hash() function now checks if dependencies: before concatenating, and falls back to hash_files_or_dirs([source_dir]) or hash_files_or_dirs([entry_point]) when dependencies is None. The fix also corrected the concatenation from + dependencies (expecting a list) to + [dependencies] (wrapping the string in a list). The existing test test_get_training_code_hash_with_source_dir covers the dependencies=None case.

Related Issue

Fixes #5518

Changes Made

  • sagemaker-core/src/sagemaker/core/workflow/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 deployed to auto-approve March 25, 2026 23:41 — with GitHub Actions Active
@aviruthen aviruthen closed this Mar 25, 2026
@aviruthen aviruthen deleted the fix/pipeline-typeerror-can-only-concatenate-list-not-5518-3 branch March 25, 2026 23:47
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