Skip to content

Commit

Permalink
Extract variables and fix wrapping (#6691)
Browse files Browse the repository at this point in the history
  • Loading branch information
nadove-ucsc committed Nov 15, 2024
1 parent 55c0669 commit adaf157
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
10 changes: 4 additions & 6 deletions src/azul/plugins/metadata/anvil/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ def from_json(entities):
for entity_ref, entity in entities.items()
}

return cls(
fqid=fqid,
entities=from_json(json_['entities']),
links=set(map(EntityLink.from_json, json_['links'])),
orphans=from_json(json_['orphans'])
)
return cls(fqid=fqid,
entities=from_json(json_['entities']),
links=set(map(EntityLink.from_json, json_['links'])),
orphans=from_json(json_['orphans']))
26 changes: 12 additions & 14 deletions src/azul/plugins/repository/tdr_anvil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,12 @@ def list_bundles(self,
bundle_uuid = change_version(dataset_row_id,
self.datarepo_row_uuid_version,
self.bundle_uuid_version)
bundles.append(TDRAnvilBundleFQID(
uuid=bundle_uuid,
version=self._version,
source=source,
table_name=BundleType.duos.value,
batch_prefix=None,
))
bundle_fqid = TDRAnvilBundleFQID(uuid=bundle_uuid,
version=self._version,
source=source,
table_name=BundleType.duos.value,
batch_prefix=None)
bundles.append(bundle_fqid)
for row in self._run_sql(f'''
SELECT datarepo_row_id
FROM {backtick(self._full_table_name(spec, BundleType.primary.value))}
Expand All @@ -275,13 +274,12 @@ def list_bundles(self,
bundle_uuid = change_version(row['datarepo_row_id'],
self.datarepo_row_uuid_version,
self.bundle_uuid_version)
bundles.append(TDRAnvilBundleFQID(
uuid=bundle_uuid,
version=self._version,
source=source,
table_name=BundleType.primary.value,
batch_prefix=None,
))
bundle_fqid = TDRAnvilBundleFQID(uuid=bundle_uuid,
version=self._version,
source=source,
table_name=BundleType.primary.value,
batch_prefix=None)
bundles.append(bundle_fqid)
prefix_lengths_by_table = self._batch_tables(source.spec, prefix)
for table_name, (batch_prefix_length, _) in prefix_lengths_by_table.items():
batch_prefixes = Prefix(common=prefix,
Expand Down

0 comments on commit adaf157

Please sign in to comment.