Repository: jmespath/jmespath.py

Issue:
0.9.1 date comparisons not working
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)

Discussion:

Patch:
diff --git a/jmespath/visitor.py b/jmespath/visitor.py
index 75af885..6c7f0c4 100644
--- a/jmespath/visitor.py
+++ b/jmespath/visitor.py
@@ -1,6 +1,7 @@
 import operator
 
 from jmespath import functions
+from jmespath.compat import string_type
 
 
 def _equals(x, y):
@@ -33,6 +34,14 @@ def _is_special_integer_case(x, y):
         return x is True or x is False
 
 
+def _is_comparable(x):
+    # The spec doesn't officially support string types yet,
+    # but enough people are relying on this behavior that
+    # it's been added back.  This should eventually become
+    # part of the official spec.
+    return _is_actual_number(x) or isinstance(x, string_type)
+
+
 def _is_actual_number(x):
     # We need to handle python's quirkiness with booleans,
     # specifically:
@@ -142,8 +151,8 @@ class TreeInterpreter(Visitor):
             left = self.visit(node['children'][0], value)
             right = self.visit(node['children'][1], value)
             num_types = (int, float)
-            if not (_is_actual_number(left) and
-                    _is_actual_number(right)):
+            if not (_is_comparable(left) and
+                    _is_comparable(right)):
                 return None
             return comparator_func(left, right)
 


Test patch:
diff --git a/tests/test_search.py b/tests/test_search.py
index 71ab3dc..c26a2fa 100644
--- a/tests/test_search.py
+++ b/tests/test_search.py
@@ -36,3 +36,10 @@ class TestSearchOptions(unittest.TestCase):
             jmespath.search('my_subtract(`10`, `3`)', {}, options=options),
             7
         )
+
+
+class TestPythonSpecificCases(unittest.TestCase):
+    def test_can_compare_strings(self):
+        # This is python specific behavior that's not in the official spec
+        # yet, but this was regression from 0.9.0 so it's been added back.
+        self.assertTrue(jmespath.search('a < b', {'a': '2016', 'b': '2017'}))