From d9645b806ded13bebc5d17b57bfae53761ee68c9 Mon Sep 17 00:00:00 2001 From: Derek Furst Date: Wed, 22 Apr 2026 15:02:23 -0400 Subject: [PATCH 1/2] modified translate uploads|collections to work with the legacy system of passing ids rather than whole entities --- src/hubmap_translator.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/hubmap_translator.py b/src/hubmap_translator.py index b2e0dea5..ee71cede 100644 --- a/src/hubmap_translator.py +++ b/src/hubmap_translator.py @@ -1234,6 +1234,10 @@ def delete(self, entity_id): # When indexing, Upload WILL NEVER BE PUBLIC def translate_upload(self, entity, reindex=False): + if isinstance(entity, str): + # This is a legacy version which passes in a uuid for an entity rather than the + # entity itself. This is most often used by a full reindex + entity = self.call_entity_api(entity_id=entity, endpoint_base='documents') try: logger.info(f"Start executing translate_upload() for {entity.get('uuid')}") @@ -1254,11 +1258,15 @@ def translate_upload(self, entity, reindex=False): , es_index=default_private_index , delete_existing_doc_first=reindex) - logger.info(f"Finished executing translate_upload() for {entity_id}") + logger.info(f"Finished executing translate_upload() for {entity.get('uuid')}") except Exception as e: logger.error(e) def translate_collection(self, entity, reindex=False): + if isinstance(entity, str) + # This is a legacy version which passes in a uuid for an entity rather than the + # entity itself. This is most often used by a full reindex + entity = self.call_entity_api(entity_id=entity, endpoint_base='documents') logger.info(f"Start executing translate_collection() for {entity.get('uuid')}") # The entity-api returns public collection with a list of connected public/published datasets, for either From 4e56f069c291b002d16c716b7470607216c969b4 Mon Sep 17 00:00:00 2001 From: Derek Furst Date: Wed, 22 Apr 2026 18:00:24 -0400 Subject: [PATCH 2/2] adjusted translate uploads|collections to account for the different form of arguments passed by the legacy translate pipipeline. adjusted some logs to go along with that --- src/hubmap_translator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hubmap_translator.py b/src/hubmap_translator.py index ee71cede..f08faf10 100644 --- a/src/hubmap_translator.py +++ b/src/hubmap_translator.py @@ -1263,7 +1263,7 @@ def translate_upload(self, entity, reindex=False): logger.error(e) def translate_collection(self, entity, reindex=False): - if isinstance(entity, str) + if isinstance(entity, str): # This is a legacy version which passes in a uuid for an entity rather than the # entity itself. This is most often used by a full reindex entity = self.call_entity_api(entity_id=entity, endpoint_base='documents') @@ -1311,11 +1311,11 @@ def translate_collection(self, entity, reindex=False): , es_index=private_index , delete_existing_doc_first=reindex) - logger.info(f"Finished executing translate_collection() for {entity_id}") + logger.info(f"Finished executing translate_collection() for {entity.get('uuid')}") except requests.exceptions.RequestException as e: logger.exception(e) # Log the error and will need fix later and reindex, rather than sys.exit() - logger.error(f"translate_collection() failed to get collection of uuid: {entity_id} via entity-api") + logger.error(f"translate_collection() failed to get collection of uuid: {entity.get('uuid')} via entity-api") except Exception as e: logger.error(e)