From f9f87ffb916cf73788062e3441cfe390382d0245 Mon Sep 17 00:00:00 2001 From: Daniel Sotirhos Date: Fri, 22 Nov 2024 10:12:20 -0800 Subject: [PATCH] fixup! [r] Support for AnVIL duos_id (#6620) --- src/azul/plugins/repository/tdr_anvil/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/azul/plugins/repository/tdr_anvil/__init__.py b/src/azul/plugins/repository/tdr_anvil/__init__.py index e5564fcce..ae69b5463 100644 --- a/src/azul/plugins/repository/tdr_anvil/__init__.py +++ b/src/azul/plugins/repository/tdr_anvil/__init__.py @@ -17,6 +17,7 @@ import uuid import attrs +from docutils.nodes import description from more_itertools import ( one, ) @@ -457,8 +458,12 @@ def _supplementary_bundle(self, bundle_fqid: TDRAnvilBundleFQID) -> TDRAnvilBund def _duos_bundle(self, bundle_fqid: TDRAnvilBundleFQID) -> TDRAnvilBundle: assert not bundle_fqid.is_batched, bundle_fqid duos_info = self.tdr.get_duos(bundle_fqid.source) - duos_id = None if duos_info is None else one(duos_info['consentGroups'])['datasetIdentifier'] - description = None if duos_info is None else duos_info.get('studyDescription') + if duos_info is None: + duos_id = None + description = None + else: + duos_id = one(duos_info['consentGroups'])['datasetIdentifier'] + description = duos_info.get('studyDescription') ref, row = self._get_dataset(bundle_fqid.source.spec) expected_entity_id = change_version(bundle_fqid.uuid, self.bundle_uuid_version,