Skip to content

fix: use .format instead of os.path.join for Processing S3 paths. #1391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions src/sagemaker/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,9 @@ def _normalize_inputs(self, inputs=None):
# and save the S3 uri in the ProcessingInput source.
parse_result = urlparse(file_input.source)
if parse_result.scheme != "s3":
desired_s3_uri = os.path.join(
"s3://",
desired_s3_uri = "s3://{}/{}/input/{}".format(
self.sagemaker_session.default_bucket(),
self._current_job_name,
"input",
file_input.input_name,
)
s3_uri = S3Uploader.upload(
Expand Down Expand Up @@ -259,11 +257,9 @@ def _normalize_outputs(self, outputs=None):
# If the output's destination is not an s3_uri, create one.
parse_result = urlparse(output.destination)
if parse_result.scheme != "s3":
s3_uri = os.path.join(
"s3://",
s3_uri = "s3://{}/{}/output/{}".format(
self.sagemaker_session.default_bucket(),
self._current_job_name,
"output",
output.output_name,
)
output.destination = s3_uri
Expand Down Expand Up @@ -475,11 +471,9 @@ def _upload_code(self, code):
str: The S3 URI of the uploaded file or directory.

"""
desired_s3_uri = os.path.join(
"s3://",
desired_s3_uri = "s3://{}/{}/input/{}".format(
self.sagemaker_session.default_bucket(),
self._current_job_name,
"input",
self._CODE_CONTAINER_INPUT_NAME,
)
return S3Uploader.upload(
Expand Down