Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
sorting keys and adding separators
  • Loading branch information
asthamohta committed May 19, 2021
commit 0c09867dba2cb0662f42d46e984ad97fbffbd957
2 changes: 0 additions & 2 deletions google/cloud/spanner_v1/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ def _make_value_pb(value):
return Value(list_value=value)
if isinstance(value, decimal.Decimal):
return Value(string_value=str(value))
if isinstance(value, dict):
return Value(string_value=value)
raise ValueError("Unknown type: %s" % (value,))


Expand Down
10 changes: 5 additions & 5 deletions tests/system/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,18 +1075,18 @@ def test_list_backups(self):
NUMERIC_1 = decimal.Decimal("0.123456789")
NUMERIC_2 = decimal.Decimal("1234567890")
JSON_1 = json.dumps({
"sample_string" : "abcdef",
"sample_int" : 872163,
"sample_array" : [23, 76, 19],
"sample_boolean" : True,
"sample_int" : 872163,
"sample_null" : None,
"sample_array" :[23, 76, 19]
})
"sample_string" : "abcdef",
}, sort_keys=True, separators=(',', ':'))
JSON_2 = json.dumps({
"sample_object" : {
"name" : "Anamika",
"id" : 2635
}
})
}, sort_keys=True, separators=(',', ':'))

ALL_TYPES_TABLE = "all_types"
ALL_TYPES_COLUMNS = (
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test__helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def test_w_json(self):
value = json.dumps({
"id" : 27863,
"Name" : "Anamika"
})
}, sort_keys=True, separators=(',', ':'))
value_pb = self._callFUT(value)
self.assertIsInstance(value_pb, Value)
self.assertEqual(value_pb.string_value, value)
Expand Down Expand Up @@ -511,7 +511,7 @@ def test_w_json(self):
VALUE = json.dumps({
"id" : 27863,
"Name" : "Anamika"
})
}, sort_keys=True, separators=(',', ':'))
field_type = Type(code=TypeCode.JSON)
value_pb = Value(string_value=VALUE)

Expand Down