Skip to content

Commit 84dce81

Browse files
committed
fix: pass ProcessingStep kwargs conditionally
To support Processor classes with different run/_normalize_args signatures without requiring every class to support **kwargs, make ProcessingStep only pass through optional args where user specifies non-null values.
1 parent 2f196cb commit 84dce81

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/sagemaker/workflow/steps.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,14 @@ def __init__(
532532
self.outputs = outputs
533533
self.job_arguments = job_arguments
534534
self.code = code
535-
self.processor_kwargs = dict(kms_key=kms_key, source_dir=source_dir)
536535
self.property_files = property_files
537536
self.job_name = None
538537

538+
self.processor_kwargs = dict(kms_key=kms_key)
539+
# Optional args supported by only a subset of Processor classes:
540+
if source_dir is not None:
541+
self.processor_kwargs["source_dir"] = source_dir
542+
539543
# Examine why run method in sagemaker.processing.Processor mutates the processor instance
540544
# by setting the instance's arguments attribute. Refactor Processor.run, if possible.
541545
self.processor.arguments = job_arguments

0 commit comments

Comments
 (0)