Skip to content

Commit 3280e79

Browse files
Fix: add roundingmode as str test (#2098)
* fix: adds test of roundingmode as a str * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent e3f57a6 commit 3280e79

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

google/cloud/bigquery/schema.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,14 @@ def __init__(
261261
raise ValueError(
262262
"If the 'field_type' is 'FOREIGN', then 'foreign_type_definition' is required."
263263
)
264+
<<<<<<< HEAD
264265
self._properties["type"] = field_type
265266

267+
=======
268+
>>>>>>> 100708d8 (Fix: add roundingmode as str test (#2098))
266269
if fields: # Don't set the property if it's not set.
267270
self._properties["fields"] = [field.to_api_repr() for field in fields]
268271

269-
270272
@classmethod
271273
def from_api_repr(cls, api_repr: Mapping[str, Any]) -> "SchemaField":
272274
"""Return a ``SchemaField`` object deserialized from a dictionary.

tests/unit/test_schema.py

+5
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ def test_fields_property(self):
324324
schema_field = self._make_one("boat", "RECORD", fields=fields)
325325
self.assertEqual(schema_field.fields, fields)
326326

327+
def test_roundingmode_property_str(self):
328+
ROUNDINGMODE = "ROUNDING_MODE_UNSPECIFIED"
329+
schema_field = self._make_one("test", "STRING", rounding_mode=ROUNDINGMODE)
330+
self.assertEqual(schema_field.rounding_mode, ROUNDINGMODE)
331+
327332
def test_to_standard_sql_simple_type(self):
328333
examples = (
329334
# a few legacy types

0 commit comments

Comments
 (0)