-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fix Elasticsearch query runner error: 'str' object has no attribute 'pop' error when parsing query #6941
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6941 +/- ##
==========================================
+ Coverage 63.76% 63.80% +0.03%
==========================================
Files 161 161
Lines 13085 13087 +2
Branches 1812 1812
==========================================
+ Hits 8344 8350 +6
+ Misses 4438 4434 -4
Partials 303 303
|
23ac140
to
667699c
Compare
Hmmm, wonder if this was caused by the pseudojson change back in Jan? ec1c4d0 That being said, this bug definitely needs fixing. 😄 @AndrewChubatiuk Are you ok to review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @AndrewChubatiuk. 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks straight forward enough, and @AndrewChubatiuk didn't spot anything wrong. 😄
@jcowley Thanks for spotting this, and fixing it. 😄 |
No problem. Thanks for getting it merged in. |
What type of PR is this?
Description
Fix Elasticsearch query runner (refactored version not yet released)
How is this tested?
I needed redash to work with elasticsearch 7.10, but the current v10.1.0 release does not support it. There was a major refactor of the elasticsearch query runner in #5794, but that code has not yet been released. So, I got the latest from master and tried it out.
I'm not sure how this code was tested originally, but it doesn't work because of a very minor bug. When building the elasticsearch query, it's trying to call
pop()
on thequery
parameter which is of typestr
, and there is nopop()
method onstr
. Any attempt to run an elasticsearch query results in the error:'str' object has no attribute 'pop' error when parsing query
It needs to be converted to a dictionary, which is a one line change. Then it works fine.
Not sure how this wasn't caught earlier. Maybe no one has tried it out yet? I do appreciate all the hard work that @NicolasLM, @susodapop, and @wwl717195673 put into the refactor. It's been working well for us after this fix.
Related Tickets & Documents
#5794