From 001f2f70e92a5641240c1484ea91a79781aecd2e Mon Sep 17 00:00:00 2001 From: David Michaels Date: Thu, 11 Jul 2024 08:32:28 -0400 Subject: [PATCH] POSSIBLE fix in search.py for frame=raw not including the uuid. --- snovault/tests/test_indexing.py | 3 +++ snovault/util.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/snovault/tests/test_indexing.py b/snovault/tests/test_indexing.py index 3db1acf1c..cd4b2dfca 100644 --- a/snovault/tests/test_indexing.py +++ b/snovault/tests/test_indexing.py @@ -1863,6 +1863,9 @@ def test_elasticsearch_item_embedded_agg(app, testapp, indexer_testapp, es_based indexer_testapp.post_json('/index', {'record': True}) time.sleep(3) target_es = es.get(index=namespaced_target, id=target_uuid) + # 2024-07-09: This adding of uuid is fallout from the fix + # in indexing_views.item_index_data for uuid in frame=raw view. + target_es_pre['_source']['properties']['uuid'] = target_es_pre['_id'] # these fields were unchanged by indexing assert target_es_pre['_source']['properties'] == target_es['_source']['properties'] assert target_es_pre['_source']['links'] == target_es['_source']['links'] diff --git a/snovault/util.py b/snovault/util.py index 245760877..23cf5525c 100644 --- a/snovault/util.py +++ b/snovault/util.py @@ -1124,8 +1124,8 @@ def merge_calculated_into_properties(properties: dict, calculated: dict): raise CalculatedOverrideOfBasePropertiesNotPermitted(calculated_sub_values, properties_sub_values) props_entry[k] = v - # 2024-07-09: This check for uuid fallout from the fix in - # indexing_views.item_index_data for uuid in frame=raw view. + # 2024-07-09: This check for uuid is fallout from the fix + # in indexing_views.item_index_data for uuid in frame=raw view. elif key != "uuid": raise ValueError('Got unexpected types for calculated/properties sub-values: ' 'calculated: %s \n properties: %s' % (calculated_sub_values, properties_sub_values))