Skip to content

Commit

Permalink
Remove synthetic file names from TDR bundle manifest entries
Browse files Browse the repository at this point in the history
  • Loading branch information
nadove-ucsc authored and hannes-ucsc committed Aug 29, 2024
1 parent 922ba3d commit e25a26b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 54 deletions.
8 changes: 3 additions & 5 deletions src/azul/plugins/repository/tdr_hca/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,13 @@ def canning_qualifier(cls) -> str:

def add_entity(self,
*,
entity_key: str,
entity: EntityReference,
row: BigQueryRow,
is_stitched: bool
) -> None:
if is_stitched:
self.stitched.add(entity.entity_id)
self._add_manifest_entry(name=entity_key,
self._add_manifest_entry(name='',
uuid=entity.entity_id,
version=TDRPlugin.format_version(row['version']),
size=row['content_size'],
Expand Down Expand Up @@ -356,11 +355,10 @@ def _emulate_bundle(self, bundle_fqid: TDRBundleFQID) -> TDRHCABundle:
rows = future.result()
pk_column = entity_type + '_id'
rows.sort(key=itemgetter(pk_column))
for i, row in enumerate(rows):
for row in rows:
entity = EntityReference(entity_id=row[pk_column], entity_type=entity_type)
is_stitched = entity not in root_entities
bundle.add_entity(entity_key=f'{entity_type}_{i}.json',
entity=entity,
bundle.add_entity(entity=entity,
row=row,
is_stitched=is_stitched)
else:
Expand Down
58 changes: 29 additions & 29 deletions test/indexer/data/1b6d8348-d6e9-406a-aa6a-7ee886e52bf9.tdr.hca.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e25a26b

Please sign in to comment.