Skip to content

Commit dc0b5a7

Browse files
committed
fix: don't use os.path.join for S3 path when uploading code and inputs in processing.
1 parent ff4245a commit dc0b5a7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/sagemaker/processing.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,9 @@ def _normalize_inputs(self, inputs=None):
213213
# and save the S3 uri in the ProcessingInput source.
214214
parse_result = urlparse(file_input.source)
215215
if parse_result.scheme != "s3":
216-
desired_s3_uri = os.path.join(
217-
"s3://",
216+
desired_s3_uri = "s3://{}/{}/input/{}".format(
218217
self.sagemaker_session.default_bucket(),
219218
self._current_job_name,
220-
"input",
221219
file_input.input_name,
222220
)
223221
s3_uri = S3Uploader.upload(
@@ -475,11 +473,9 @@ def _upload_code(self, code):
475473
str: The S3 URI of the uploaded file or directory.
476474
477475
"""
478-
desired_s3_uri = os.path.join(
479-
"s3://",
476+
desired_s3_uri = "s3://{}/{}/input/{}".format(
480477
self.sagemaker_session.default_bucket(),
481478
self._current_job_name,
482-
"input",
483479
self._CODE_CONTAINER_INPUT_NAME,
484480
)
485481
return S3Uploader.upload(

0 commit comments

Comments
 (0)