Skip to content

Commit

Permalink
POSSIBLE fix in search.py for frame=raw not including the uuid.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Jul 11, 2024
1 parent 85e4732 commit 001f2f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions snovault/tests/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
4 changes: 2 additions & 2 deletions snovault/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 001f2f7

Please sign in to comment.