-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.triage meI really want to be triaged.I really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
If I construct an integer too long to encode as a 64-bit integer, get_protobuf_attribute_and_value() does not raise a ValueError:
>>> gcloud.datastore.helpers.get_protobuf_attribute_and_value
>>> too_long = 1 << 63
>>> get_protobuf_attribute_and_value(too_long)
('integer_value', 9223372036854775808L)
even though that value is not usable for an 'integer_value' field:
>>> from gcloud.datastore.datastore_v1_pb2 import Property
>>> pb = Property()
>>> pb.value.integer_value = too_long
...
File ".../lib/python2.7/site-packages/google/protobuf/internal/type_checkers.py", line 119, in CheckValue
raise ValueError('Value out of range: %d' % proposed_value)
ValueError: Value out of range: 9223372036854775808
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.triage meI really want to be triaged.I really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.