-
Notifications
You must be signed in to change notification settings - Fork 37
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
Allow string comparison #49
Allow string comparison #49
Conversation
9c0cce6
to
2d4691f
Compare
Hello @alextwoods, I just noticed that you've recently pushed a few updates to this repository. I've rebased this PR with |
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.
Overall the code itself looks reasonable - my main concern is that the JMESPath spec is explicit that comparisons operations are valid only for numbers and other types must return null.
Do you know if other implementations support string comparison?
This library currently only supports "comparison" of numberic values. This appears to match the JMESPath spec but is not consistent with other implementations (for example: [`jmespath.py`](jmespath/jmespath.py#126)). Resolves: jmespath#47
2d4691f
to
7f0a880
Compare
Thanks for the quick response @alextwoods. FWIW - I removed the debug code and amended the commit. |
Thanks for the patience - I'm working with @jamesls on possible updates on the spec. The issue is in defining the string comparisons in a way that implementations will be consistent (this gets complex, see: https://unicode.org/reports/tr10/). One possibility is to just say its utf8 encoding byte comparison. |
I'm going to go ahead and merge this and release a new version of jmespath - we'll work on getting the spec updated as well. Thanks for the contribution! |
This has been released as jmespath 1.6.0 |
This library currently only supports "comparison" of numberic values. This appears to match the JMESPath spec but is not consistent with other implementations (for example:
jmespath.py
).Resolves: #47