Skip to content

Commit 1de36e7

Browse files
authored
Merge pull request #25 from AllenInstitute/hotfix/prep-data-sync-param-carryover-bug
Carry over missed parameters from PrepareBatchDataSyncRequest to DataSyncRequest
2 parents d5ff474 + e752f98 commit 1de36e7

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

src/aibs_informatics_aws_lambda/handlers/data_sync/operations.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ def handle(self, request: PrepareBatchDataSyncRequest) -> PrepareBatchDataSyncRe
201201
max_concurrency=request.max_concurrency,
202202
retain_source_data=request.retain_source_data,
203203
require_lock=request.require_lock,
204+
force=request.force,
205+
size_only=request.size_only,
206+
fail_if_missing=request.fail_if_missing,
207+
include_detailed_response=request.include_detailed_response,
208+
remote_to_local_config=request.remote_to_local_config,
204209
)
205210
)
206211
batch_data_sync_requests.append(BatchDataSyncRequest(requests=data_sync_requests))

test/aibs_informatics_aws_lambda/handlers/data_sync/test_operations.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,43 @@ def test__handle__prepare_local_to_s3__simple(self):
206206
)
207207
self.assertHandles(self.handler, request.to_dict(), expected.to_dict())
208208

209+
def test__handle__prepare_local_to_s3__simple__non_default_args_preserved(self):
210+
fs = self.setUpLocalFS(
211+
("a", 1),
212+
("b", 1),
213+
("c", 1),
214+
)
215+
source_path = fs
216+
destination_path = S3Path.build(bucket_name="bucket", key="key/")
217+
request = PrepareBatchDataSyncRequest(
218+
source_path=source_path,
219+
destination_path=destination_path,
220+
batch_size_bytes_limit=10,
221+
max_concurrency=10,
222+
retain_source_data=True,
223+
size_only=True,
224+
force=True,
225+
include_detailed_response=True,
226+
)
227+
expected = PrepareBatchDataSyncResponse(
228+
requests=[
229+
BatchDataSyncRequest(
230+
requests=[
231+
DataSyncRequest(
232+
source_path=source_path,
233+
destination_path=destination_path,
234+
max_concurrency=10,
235+
retain_source_data=True,
236+
size_only=True,
237+
force=True,
238+
include_detailed_response=True,
239+
)
240+
]
241+
)
242+
]
243+
)
244+
self.assertHandles(self.handler, request.to_dict(), expected.to_dict())
245+
209246
def test__handle__prepare_local_to_s3__simple__upload_to_s3(self):
210247
fs = self.setUpLocalFS(
211248
("a", 1),

0 commit comments

Comments
 (0)