mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-12 15:57:44 +00:00
MINOR - fix(elasticsearch): add None value filter (#18711)
* fix(elasticsearch.py) - add None value filter Sometimes elasticsearch returns lists with None values in it. To fix this issue we need to filter them out first, befor returning most relevant to the endpoint. * fix tests --------- Co-authored-by: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Co-authored-by: ulixius9 <mayursingal9@gmail.com>
This commit is contained in:
parent
956a13f3f0
commit
65928c149a
@ -88,6 +88,9 @@ def get_entity_from_es_result(
|
||||
:param entity_list: ES query result
|
||||
:return: single entity
|
||||
"""
|
||||
if entity_list is None:
|
||||
return None
|
||||
entity_list = [e for e in entity_list if e is not None]
|
||||
if entity_list and len(entity_list):
|
||||
if fetch_multiple_entities:
|
||||
return entity_list
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user