@@ -138,13 +138,18 @@ def _paginate_request(
138
138
except KeyError :
139
139
pagination_config = None
140
140
141
+ # If _expect_standard_dictionaries is true, input items are expected to be standard dictionaries,
142
+ # and need to be converted to DDB-JSON before encryption.
141
143
if self ._expect_standard_dictionaries :
142
144
if "TableName" in client_kwargs :
143
145
self ._resource_to_client_shape_converter .table_name = client_kwargs ["TableName" ]
144
146
client_kwargs = input_item_to_ddb_transform_method (client_kwargs )
145
147
148
+ # Apply DBESDK transformations to the input
146
149
transformed_request = input_transform_method (input_transform_shape (sdk_input = client_kwargs )).transformed_input
147
150
151
+ # If _expect_standard_dictionaries is true, the boto3 client expects items to be standard dictionaries,
152
+ # and need to be converted from DDB-JSON to a standard dictionary before being passed to the boto3 client.
148
153
if self ._expect_standard_dictionaries :
149
154
transformed_request = input_item_to_dict_transform_method (transformed_request )
150
155
@@ -154,18 +159,24 @@ def _paginate_request(
154
159
sdk_page_response = self ._paginator .paginate (** transformed_request )
155
160
156
161
for page in sdk_page_response :
162
+ # If _expect_standard_dictionaries is true, the boto3 client returns items as standard dictionaries,
163
+ # and needs to convert the standard dictionary to DDB-JSON before passing the response to the DBESDK.
157
164
if self ._expect_standard_dictionaries :
158
165
page = output_item_to_ddb_transform_method (page )
159
166
167
+ # Apply DBESDK transformation to the boto3 output
160
168
dbesdk_response = output_transform_method (
161
169
output_transform_shape (
162
170
original_input = client_kwargs ,
163
171
sdk_output = page ,
164
172
)
165
173
).transformed_output
166
174
175
+ # Copy any missing fields from the SDK output to the response (e.g. ConsumedCapacity)
167
176
dbesdk_response = self ._copy_sdk_response_to_dbesdk_response (page , dbesdk_response )
168
177
178
+ # If _expect_standard_dictionaries is true, the boto3 client expects items to be standard dictionaries,
179
+ # and need to be converted from DDB-JSON to a standard dictionary before returning the response.
169
180
if self ._expect_standard_dictionaries :
170
181
dbesdk_response = output_item_to_dict_transform_method (dbesdk_response )
171
182
0 commit comments