Reverse slices result in negative size
See original GitHub issuesearch[20:0]
results in -20
as the size sent to ElasticSearch. This can possibly cause an error: RequestError(400, 'search_phase_execution_exception', 'numHits must be > 0; please use TotalHitCountCollector if you just need the total hit count')
Proposed Solution:
The slice function should result in a minimum size of 0
s._extra['size'] = n.stop - (n.start or 0) if n.stop is not None else 10
s._extra['size'] = max(s._extra['size'], 0)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
What Is [::-1] in Python? - codingem.com
To reverse the slicing, specify a negative step value. As you want to include each value in the reversed list, the step size...
Read more >Python Reverse List with Slicing — An Illustrated Guide - Finxter
Your goal is to reverse the elements to obtain the following result: ... You can use a negative step size (e.g., -1) to...
Read more >How to explain the reverse of a sequence by slice notation a[::-1]
For a negative step , the substituted values for None are len(a) - 1 for the start and -len(a) - 1 for the...
Read more >How To Reverse Python Lists More Efficiently
It specifies a negative step size of 1, which means that the element are retrieved in the reversed order (from end to start)...
Read more >Reverse Strings in Python: reversed(), Slicing, and More
In this step-by-step tutorial, you'll learn how to reverse strings in Python by using available tools such as reversed() and slicing operations.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@shanon-equityzen I can try to get a patch release out tomorrow.
@bk-equityzen Released v7.2.1