Skip to content

Commit

Permalink
fix pytype
Browse files Browse the repository at this point in the history
  • Loading branch information
tswast committed Dec 27, 2024
1 parent 602effa commit da8f299
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions google/cloud/bigquery/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import collections
import enum
from typing import Any, Dict, Iterable, Optional, Union
from typing import Any, cast, Dict, Iterable, Optional, Union

from google.cloud.bigquery import _helpers
from google.cloud.bigquery import standard_sql
Expand Down Expand Up @@ -243,7 +243,7 @@ def field_type(self):
type_ = self._properties.get("type")
if type_ is None: # Shouldn't happen, but some unit tests do this.
return None
return type_.upper()
return cast(str, type_).upper()

@property
def mode(self):
Expand All @@ -252,7 +252,7 @@ def mode(self):
See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#TableFieldSchema.FIELDS.mode
"""
return self._properties.get("mode", "NULLABLE").upper()
return cast(str, self._properties.get("mode", "NULLABLE")).upper()

@property
def is_nullable(self):
Expand Down

0 comments on commit da8f299

Please sign in to comment.