File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -259,11 +259,10 @@ def __init__(
259259 if self ._properties .get ("foreignTypeDefinition" ) is None :
260260 raise ValueError (
261261 "If the 'field_type' is 'FOREIGN', then 'foreign_type_definition' is required."
262- )
262+ )
263263 if fields : # Don't set the property if it's not set.
264264 self ._properties ["fields" ] = [field .to_api_repr () for field in fields ]
265265
266-
267266 @classmethod
268267 def from_api_repr (cls , api_repr : dict ) -> "SchemaField" :
269268 """Return a ``SchemaField`` object deserialized from a dictionary.
Original file line number Diff line number Diff line change @@ -314,6 +314,11 @@ def test_fields_property(self):
314314 schema_field = self ._make_one ("boat" , "RECORD" , fields = fields )
315315 self .assertEqual (schema_field .fields , fields )
316316
317+ def test_roundingmode_property_str (self ):
318+ ROUNDINGMODE = "ROUNDING_MODE_UNSPECIFIED"
319+ schema_field = self ._make_one ("test" , "STRING" , rounding_mode = ROUNDINGMODE )
320+ self .assertEqual (schema_field .rounding_mode , ROUNDINGMODE )
321+
317322 def test_to_standard_sql_simple_type (self ):
318323 examples = (
319324 # a few legacy types
You can’t perform that action at this time.
0 commit comments