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

0.9.1 date comparisons not working #124

Closed
goodwinb99 opened this Issue Mar 3, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@goodwinb99

goodwinb99 commented Mar 3, 2017

From https://gitter.im/jmespath/chat:

aws ec2 describe-snapshots --owner-id self --query 'Snapshots[?StartTime>='2017--02-01']'
The above command returns and empty set ( '[]' ) when run with v0.9.1, and a list of appropriate snapshots with run with v0.9.0.

I have the same problem fetching AMIs by date. It appears Date comparisons (except ==) are broken in 0.9.1 (and work fine in 0.9.0)

@jamesls

This comment has been minimized.

Member

jamesls commented Mar 10, 2017

I'll add this behavior back.

What's going on here is that the spec only defines comparisons as valid on numbers (http://jmespath.org/specification.html#ordering-operators). In 0.9.1, validation was added to enforce this requirement, so things that implicitly worked before now no longer work.

Given this is affecting multiple people I'll add back the support for strings now. I'll also work on getting the spec updated.

jamesls added a commit to jamesls/jmespath that referenced this issue Mar 10, 2017

Add back support for order comparisons against strings
The validation added in 0.9.1 to make this compliant with the
spec actually broke a number of people.  I've added this back
and will work on getting the spec updated.

Fixes jmespath#124.

@jamesls jamesls closed this in #126 Mar 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment