Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions gcloud/datastore/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import datetime

from google.protobuf.internal.type_checkers import Int64ValueChecker
import six

from gcloud._helpers import _datetime_from_microseconds
Expand All @@ -30,8 +29,6 @@

__all__ = ('entity_from_protobuf', 'key_from_protobuf')

INT_VALUE_CHECKER = Int64ValueChecker()


def find_true_project(project, connection):
"""Find the true (unaliased) project.
Expand Down Expand Up @@ -318,8 +315,7 @@ def _pb_attr_value(val):
elif isinstance(val, float):
name, value = 'double', val
elif isinstance(val, six.integer_types):
INT_VALUE_CHECKER.CheckValue(val) # Raise an exception if invalid.
name, value = 'integer', int(val) # Always cast to an integer.
name, value = 'integer', val
elif isinstance(val, six.text_type):
name, value = 'string', val
elif isinstance(val, (bytes, str)):
Expand Down
8 changes: 0 additions & 8 deletions gcloud/datastore/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,6 @@ def test_long(self):
self.assertEqual(name, 'integer_value')
self.assertEqual(value, must_be_long)

def test_long_too_small(self):
too_small = -(1 << 63) - 1
self.assertRaises(ValueError, self._callFUT, too_small)

def test_long_too_large(self):
too_large = 1 << 63
self.assertRaises(ValueError, self._callFUT, too_large)

def test_native_str(self):
import six
name, value = self._callFUT('str')
Expand Down