jmespath / jmespath/jmespath.py
'<' filter works incorrect in some cases
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 212
- PR merge metrics
- No merged PRs in 30d
Description
JMESPath fails with `TypeError: unorderable types: int() < str()` error in following case:
test.json
```
[
{
"id": 1,
"sha": "abc",
"ref": "develop",
"status": "running"
},
{
"id": 2,
"sha": "abc",
"ref": "develop",
"status": "running"
}
]
```
sample python script
```
import json
import jmespath
query = "[?id < '2']"
expression = jmespath.compile(query)
with open('test.json') as f:
data = json.load(f)
r = expression.search(data)
print(r)
```
The same example works fine on http://jmespath.org/
jmespath version: 0.9.3
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.