Skip to content

Commit 653e197

Browse files
authored
Merge pull request #947 from hubmapconsortium/yuanzhou/cache-exclude
Add get_excluded_query_props() check to the cache handling
2 parents 7d8bb87 + cfb833a commit 653e197

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/schema/schema_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -851,10 +851,10 @@ def get_complete_entity_result(request, token, entity_dict, properties_to_skip =
851851
cache_key = f'{_memcached_prefix}_complete_{entity_uuid}'
852852
cache_result = _memcached_client.get(cache_key)
853853

854-
# As long as `properties_to_skip` is specified (including when`?exclude` is used in query parameter)
854+
# As long as `properties_to_skip` is specified or when`?exclude` is used in query parameter
855855
# Do not return the cached data and store the new cache regardless of it's available or not - Zhou 10/10/2025
856-
if properties_to_skip:
857-
logger.info(f'Skipped/excluded properties {properties_to_skip} specified in get_complete_entity_result() for {entity_type} {entity_uuid}. Always generate the {TriggerTypeEnum.ON_READ} data and do not cache the result.')
856+
if properties_to_skip or get_excluded_query_props(request):
857+
logger.info(f'Skipped/excluded properties specified for {entity_type} {entity_uuid}. Always generate the {TriggerTypeEnum.ON_READ} data and do not cache the result.')
858858

859859
# No error handling here since if a 'on_read_trigger' method fails,
860860
# the property value will be the error message
@@ -873,7 +873,7 @@ def get_complete_entity_result(request, token, entity_dict, properties_to_skip =
873873
# Remove properties of None value
874874
complete_entity = remove_none_values(complete_entity_dict)
875875
else:
876-
logger.info(f'Skipped/excluded properties NOT specified in get_complete_entity_result() for {entity_type} {entity_uuid}.')
876+
logger.info(f'Skipped/excluded properties NOT specified for {entity_type} {entity_uuid}.')
877877

878878
# Re-generate the triggered data and add to memcache
879879
# Otherwise, use the cached data if found and still valid

0 commit comments

Comments
 (0)