Skip to content

Commit fd29b54

Browse files
committed
small fix
1 parent 01254b2 commit fd29b54

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

src/sagemaker/apiutils/_base_types.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,23 @@ def _boto_ignore(cls):
4242
return ["ResponseMetadata"]
4343

4444
@classmethod
45-
def from_boto(cls, boto_dict, **kwargs): # pylint: disable=R1710
45+
def from_boto(cls, boto_dict, **kwargs):
4646
"""Construct an instance of this ApiObject from a boto response.
4747
4848
Args:
4949
boto_dict (dict): A dictionary of a boto response.
5050
**kwargs: Arbitrary keyword arguments
5151
"""
52-
if boto_dict:
53-
boto_dict = {k: v for k, v in boto_dict.items() if k not in cls._boto_ignore()}
54-
custom_boto_names_to_member_names = {a: b for b, a in cls._custom_boto_names.items()}
55-
cls_kwargs = _boto_functions.from_boto(
56-
boto_dict, custom_boto_names_to_member_names, cls._custom_boto_types
57-
)
58-
cls_kwargs.update(kwargs)
59-
return cls(**cls_kwargs)
52+
if not boto_dict:
53+
return None
54+
55+
boto_dict = {k: v for k, v in boto_dict.items() if k not in cls._boto_ignore()}
56+
custom_boto_names_to_member_names = {a: b for b, a in cls._custom_boto_names.items()}
57+
cls_kwargs = _boto_functions.from_boto(
58+
boto_dict, custom_boto_names_to_member_names, cls._custom_boto_types
59+
)
60+
cls_kwargs.update(kwargs)
61+
return cls(**cls_kwargs)
6062

6163
@classmethod
6264
def to_boto(cls, obj):

src/sagemaker/processing.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,8 +1024,6 @@ def __init__(
10241024
def _to_request_dict(self):
10251025
"""Generates a request dictionary using the parameters provided to the class."""
10261026

1027-
# self._create_s3_input()
1028-
10291027
# Create the request dictionary.
10301028
s3_input_request = {"InputName": self.input_name, "AppManaged": self.app_managed}
10311029

@@ -1062,9 +1060,7 @@ def _create_s3_input(self):
10621060
self.s3_data_type = self.s3_input.s3_data_type
10631061
self.s3_input_mode = self.s3_input.s3_input_mode
10641062
self.s3_data_distribution_type = self.s3_input.s3_data_distribution_type
1065-
return
1066-
1067-
if self.source and self.destination:
1063+
elif self.source and self.destination:
10681064
self.s3_input = S3Input(
10691065
s3_uri=self.source,
10701066
local_path=self.destination,

0 commit comments

Comments
 (0)