Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quick check to PaginatorIterator to check if the hits dictionary … #545

Closed
wants to merge 1 commit into from
Closed

Conversation

ryancambray-ct
Copy link

…contains the element '_highlightResult'

This is to avoid the iterators file throwing a KeyError when the element does not contain this.

Q A
Bug fix? yes
New feature? no
BC breaks? no
Related Issue Fix #544
Need Doc update yes/no

Describe your change

Checks if the hit element contains the key '_highlightResult' before removing it from the element.

What problem is this fixing?

When batch saving rules called from the browse_rules API call, the RuleIterator throws a KeyError if the rule element does not contain the key '_highlightResult'. This is a rare occurrence but it is possible.

…contains the element '_highlightResult'

This is to avoid the iterators file throwing a KeyError when the element does not contain this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeyError when batch saving rules from browse_rules()
1 participant