Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 97f2e23

Browse filesBrowse files
committed
Merge pull request #1626 from tseaver/drop-protobuf-internal-typechecker
Drop look-before-leap use of protobuf-internal type checker.
2 parents e433c37 + 0a4e531 commit 97f2e23
Copy full SHA for 97f2e23

File tree

Expand file treeCollapse file tree

2 files changed

+1
-13
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+1
-13
lines changed

‎gcloud/datastore/helpers.py

Copy file name to clipboardExpand all lines: gcloud/datastore/helpers.py
+1-5Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import datetime
2121

22-
from google.protobuf.internal.type_checkers import Int64ValueChecker
2322
import six
2423

2524
from gcloud._helpers import _datetime_from_microseconds
@@ -30,8 +29,6 @@
3029

3130
__all__ = ('entity_from_protobuf', 'key_from_protobuf')
3231

33-
INT_VALUE_CHECKER = Int64ValueChecker()
34-
3532

3633
def find_true_project(project, connection):
3734
"""Find the true (unaliased) project.
@@ -318,8 +315,7 @@ def _pb_attr_value(val):
318315
elif isinstance(val, float):
319316
name, value = 'double', val
320317
elif isinstance(val, six.integer_types):
321-
INT_VALUE_CHECKER.CheckValue(val) # Raise an exception if invalid.
322-
name, value = 'integer', int(val) # Always cast to an integer.
318+
name, value = 'integer', val
323319
elif isinstance(val, six.text_type):
324320
name, value = 'string', val
325321
elif isinstance(val, (bytes, str)):

‎gcloud/datastore/test_helpers.py

Copy file name to clipboardExpand all lines: gcloud/datastore/test_helpers.py
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -457,14 +457,6 @@ def test_long(self):
457457
self.assertEqual(name, 'integer_value')
458458
self.assertEqual(value, must_be_long)
459459

460-
def test_long_too_small(self):
461-
too_small = -(1 << 63) - 1
462-
self.assertRaises(ValueError, self._callFUT, too_small)
463-
464-
def test_long_too_large(self):
465-
too_large = 1 << 63
466-
self.assertRaises(ValueError, self._callFUT, too_large)
467-
468460
def test_native_str(self):
469461
import six
470462
name, value = self._callFUT('str')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.