uranusjr commented on code in PR #23888:
URL: https://github.com/apache/airflow/pull/23888#discussion_r884450207
##########
tests/providers/elasticsearch/log/elasticmock/fake_elasticsearch.py:
##########
@@ -362,6 +363,18 @@ def match_must_phrase(document, matches, must):
# use in as a proxy for match_phrase
matches.append(document)
+ # Check index(es) exists
+ def _validate_search_targets(self, targets):
+ matches = set()
+ for target in targets:
+ if target == '_all':
+ matches.update(self.__documents_dict.keys())
+ elif '*' in target:
+ matches.update(fnmatch.filter(self.__documents_dict.keys(),
target))
+ elif target not in self.__documents_dict:
+ raise NotFoundError(404, f'IndexMissingException[[{target}]
missing]')
Review Comment:
OK, let’s just fix the unnecessary `keys()` calls then.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]