Skip to content

Commit

Permalink
Fix pagination bug in download-collection
Browse files Browse the repository at this point in the history
This commit changes :meth:`download_collection` to use
:meth:`_get_full_bundle_manifest`, which addresses two bugs:
* Previously, download-collection would not download all files
  in a bundle were pagination required.
* Previously, download-collection would not check for possible
  filename collisions before attempting to download a bundle.
  • Loading branch information
natanlao committed Aug 17, 2019
1 parent ad81839 commit 2d9043a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hca/dss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ def _serialize_col_to_manifest(self, uuid, replica, version):
rows = []
seen = []
col = self.get_collection(uuid=uuid, replica=replica, version=version)['contents']
context = DownloadContext(download_dir=None, dss_client=self, replica=replica,
num_retries=0, min_delay_seconds=0)
while col:
obj = col.pop()
if obj['type'] == 'file':
Expand All @@ -354,8 +356,8 @@ def _serialize_col_to_manifest(self, uuid, replica, version):
col.extend(self.get_collection(uuid=obj['uuid'], replica=replica,
version=obj.get('version', ''))['contents'])
elif obj['type'] == 'bundle':
bundle = self.get_bundle(replica=replica, version=obj.get('version', ''),
uuid=obj['uuid'])
bundle = context._get_full_bundle_manifest(bundle_uuid=obj['uuid'],
version=obj['version'])
rows.extend(({
'bundle_uuid': obj['uuid'],
'bundle_version': obj.get('version', None),
Expand Down

0 comments on commit 2d9043a

Please sign in to comment.