From 20339a5dad5e6ffa1ef408b41915b4a88525ad99 Mon Sep 17 00:00:00 2001 From: JJ Geewax Date: Fri, 3 Oct 2014 09:30:47 -0400 Subject: [PATCH] Fix #215: Helper for int and double now work as expected. --- gcloud/datastore/helpers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcloud/datastore/helpers.py b/gcloud/datastore/helpers.py index 5f3965213729..8ab6d571d6c6 100644 --- a/gcloud/datastore/helpers.py +++ b/gcloud/datastore/helpers.py @@ -7,7 +7,7 @@ from gcloud.datastore.key import Key -INT64 = Int64ValueChecker().CheckValue +check_int64_value = Int64ValueChecker().CheckValue def get_protobuf_attribute_and_value(val): @@ -56,7 +56,8 @@ def get_protobuf_attribute_and_value(val): elif isinstance(val, float): name, value = 'double', val elif isinstance(val, (int, long)): - name, value = 'integer', INT64(val) + check_int64_value(val) # This will raise an exception if invalid. + name, value = 'integer', val elif isinstance(val, basestring): name, value = 'string', val