-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,14 @@ | |
import calendar | ||
from datetime import datetime, timedelta | ||
|
||
from google.protobuf.internal.type_checkers import Int64ValueChecker | ||
import pytz | ||
|
||
from gcloud.datastore.key import Key | ||
|
||
|
||
INT64 = Int64ValueChecker().CheckValue | ||
|
||
def get_protobuf_attribute_and_value(val): | ||
"""Given a value, return the protobuf attribute name and proper value. | ||
|
@@ -53,7 +56,7 @@ def get_protobuf_attribute_and_value(val): | |
elif isinstance(val, float): | ||
name, value = 'double', val | ||
elif isinstance(val, (int, long)): | ||
name, value = 'integer', val | ||
name, value = 'integer', INT64(val) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dhermes
Contributor
|
||
elif isinstance(val, basestring): | ||
name, value = 'string', val | ||
|
||
|
@tseaver : This actually shouldn't work :(
https://code.google.com/p/protobuf/source/browse/trunk/python/google/protobuf/internal/type_checkers.py?r=163#100 returns None. We need to check and then return "val".
Opening a ticket for this.