From 94a90052e5684bafb08f2b2f6afb262c6958113e Mon Sep 17 00:00:00 2001 From: kburke Date: Tue, 30 Apr 2024 11:47:01 -0400 Subject: [PATCH] Assign all parent entities as source_samples in the OpenSearch document if the first parent tested is a Sample. --- src/hubmap_translator.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/hubmap_translator.py b/src/hubmap_translator.py index 54359a11..efca3129 100644 --- a/src/hubmap_translator.py +++ b/src/hubmap_translator.py @@ -924,12 +924,9 @@ def generate_doc(self, entity, return_type): try: if parents[0]['entity_type'] == 'Sample': - # Inside of this method, only the form of an entity suitable for indexing is supported. - # So use the uuid of the parent Sample to retrieve an indexable document for the Sample. - parent_sample_dict = self.call_entity_api(entity_id=parents[0]['uuid'] - ,endpoint='documents') - - entity['source_samples'] = [parent_sample_dict] + # If one parent entity of this Dataset is a Sample, then all parent entities + # of this Dataset must be Samples. + entity['source_samples'] = parents e = parents[0] except IndexError: entity['source_samples'] = []