Closed stevennic closed 5 years ago
Merging #536 into master will increase coverage by
0.03%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #536 +/- ##
=========================================
+ Coverage 82.97% 83% +0.03%
=========================================
Files 132 132
Lines 29602 29610 +8
=========================================
+ Hits 24562 24578 +16
+ Misses 5040 5032 -8
Impacted Files | Coverage Δ | |
---|---|---|
tests/test_parsing.py | 100% <100%> (ø) |
:arrow_up: |
src/whoosh/qparser/plugins.py | 95.73% <100%> (+0.47%) |
:arrow_up: |
src/whoosh/index.py | 76.01% <0%> (+1.55%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update a8a15c4...1f6865c. Read the comment docs.
Merged, thanks for your contribution!
Resolve bug #480.
This happens with numeric ranges in parentheses. The root cause was an omission in
plugins.py:GtLtPlugin
. During thefilterize()
function inqparser/default.py:329
, the nodes are run through all registered plugins in sequence. In theGtLtPlugin (qparser/plugins.py)
, the main methoddo_gtlt
convertsGtLtNode
nodes toRangeNode
nodes but omitted to recurse down its subnodes to do the same. As a result, ranges inside a parenthesis were being ignored, leaving the ranges in their raw, unprocessed form. The nodes coming out of thefilterize()
function should never have aGtLtNode
because they don't have a query() method. Thus the OP's scenario raises aNotImplementedError
exception.The solution properly recurses through the nodes and yields a fully processed query node tree.