Skip to content

Commit 9ca799c

Browse files
committed
add s3 uri check to modeltrainer data source
1 parent 65482fa commit 9ca799c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sagemaker/modules/train/model_trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def _validate_source_code(self, source_code: Optional[SourceCode]):
407407
"If 'requirements' or 'entry_script' is provided in 'source_code', "
408408
+ "'source_dir' must also be provided.",
409409
)
410-
if not _is_valid_path(source_dir, path_type="Directory"):
410+
if not _is_valid_path(source_dir, path_type="Directory") or _is_valid_s3_uri(source_dir, path_type="Directory"):
411411
raise ValueError(
412412
f"Invalid 'source_dir' path: {source_dir}. " + "Must be a valid directory.",
413413
)

0 commit comments

Comments
 (0)