-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Great library. Thanks.
Problem:
Today I noticed that it crashed when you have a list of objects which is then sorted and the keys have different data types.
TypeError: '<' not supported between instances of 'str' and 'int'
in init.py in _sorter at line 205
with
obj=[[
0, {
code: 0,
someothervalue: 'asd'
}],
[
1, {
code: 'N',
someothervalue: 'dfdf'
}]]
and
sortby=code
Expected behaviour:
Since there is no rfc for JSON path, I am not sure what the conventional behaviour is then. I assume that sorting by casting all to string makes sense if one of them is a string. Other option would be to throw a custom error.
Metadata
Metadata
Assignees
Labels
No labels