Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/hubmap_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')}")

Expand All @@ -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
Expand Down
Loading