Skip to content

Commit 602effa

Browse files
committed
remove unused private method
1 parent 4d0e816 commit 602effa

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

google/cloud/bigquery/schema.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import enum
1919
from typing import Any, Dict, Iterable, Optional, Union
2020

21+
from google.cloud.bigquery import _helpers
2122
from google.cloud.bigquery import standard_sql
2223
from google.cloud.bigquery.enums import StandardSqlTypeNames
2324

@@ -206,13 +207,6 @@ def __init__(
206207
if fields: # Don't set the property if it's not set.
207208
self._properties["fields"] = [field.to_api_repr() for field in fields]
208209

209-
@staticmethod
210-
def __get_int(api_repr, name):
211-
v = api_repr.get(name, _DEFAULT_VALUE)
212-
if v is not _DEFAULT_VALUE:
213-
v = int(v)
214-
return v
215-
216210
@classmethod
217211
def from_api_repr(cls, api_repr: dict) -> "SchemaField":
218212
"""Return a ``SchemaField`` object deserialized from a dictionary.
@@ -278,17 +272,17 @@ def description(self):
278272
@property
279273
def precision(self):
280274
"""Optional[int]: Precision (number of digits) for the NUMERIC field."""
281-
return self._properties.get("precision")
275+
return _helpers._int_or_none(self._properties.get("precision"))
282276

283277
@property
284278
def scale(self):
285279
"""Optional[int]: Scale (digits after decimal) for the NUMERIC field."""
286-
return self._properties.get("scale")
280+
return _helpers._int_or_none(self._properties.get("scale"))
287281

288282
@property
289283
def max_length(self):
290284
"""Optional[int]: Maximum length for the STRING or BYTES field."""
291-
return self._properties.get("maxLength")
285+
return _helpers._int_or_none(self._properties.get("maxLength"))
292286

293287
@property
294288
def range_element_type(self):

0 commit comments

Comments
 (0)