File tree Expand file tree Collapse file tree 5 files changed +10
-14
lines changed
Expand file tree Collapse file tree 5 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -837,8 +837,8 @@ def schema(self):
837837 """
838838 # TODO: The typehinting for this needs work. Setting this pragma to temporarily
839839 # manage a pytype issue that came up in another PR. See Issue: #2132
840- prop = self ._properties .get ("schema" , {}) # type: ignore
841- return [SchemaField .from_api_repr (field ) for field in prop .get ("fields" , [])] # type: ignore
840+ prop : Dict [ str , Any ] = self ._properties .get ("schema" , {})
841+ return [SchemaField .from_api_repr (field ) for field in prop .get ("fields" , [])]
842842
843843 @schema .setter
844844 def schema (self , value ):
Original file line number Diff line number Diff line change @@ -437,7 +437,7 @@ def configuration(self) -> _JobConfig:
437437 """Job-type specific configurtion."""
438438 # TODO: The typehinting for this needs work. Setting this pragma to temporarily
439439 # manage a pytype issue that came up in another PR. See Issue: #2132
440- configuration = self ._CONFIG_CLASS () # pytype: disable=not-callable
440+ configuration : _JobConfig = self ._CONFIG_CLASS () # pytype: disable=not-callable
441441 configuration ._properties = self ._properties .setdefault ("configuration" , {})
442442 return configuration
443443
Original file line number Diff line number Diff line change @@ -520,21 +520,21 @@ def project(self):
520520 """str: ID of the project containing the routine."""
521521 # TODO: The typehinting for this needs work. Setting this pragma to temporarily
522522 # manage a pytype issue that came up in another PR. See Issue: #2132
523- return self ._properties [ "projectId" ] # pytype: disable=typed-dict-error
523+ return self ._properties . get ( "projectId" , "" )
524524
525525 @property
526526 def dataset_id (self ):
527527 """str: ID of dataset containing the routine."""
528528 # TODO: The typehinting for this needs work. Setting this pragma to temporarily
529529 # manage a pytype issue that came up in another PR. See Issue: #2132
530- return self ._properties [ "datasetId" ] # pytype: disable=typed-dict-error
530+ return self ._properties . get ( "datasetId" , "" )
531531
532532 @property
533533 def routine_id (self ):
534534 """str: The routine ID."""
535535 # TODO: The typehinting for this needs work. Setting this pragma to temporarily
536536 # manage a pytype issue that came up in another PR. See Issue: #2132
537- return self ._properties [ "routineId" ] # pytype: disable=typed-dict-error
537+ return self ._properties . get ( "routineId" , "" )
538538
539539 @property
540540 def path (self ):
Original file line number Diff line number Diff line change @@ -234,11 +234,7 @@ def __init__(
234234 if policy_tags is not _DEFAULT_VALUE :
235235 # TODO: The typehinting for this needs work. Setting this pragma to temporarily
236236 # manage a pytype issue that came up in another PR. See Issue: #2132
237- self ._properties ["policyTags" ] = (
238- policy_tags .to_api_repr () # pytype: disable=attribute-error
239- if policy_tags is not None
240- else None
241- )
237+ self ._properties ["policyTags" ] = policy_tags .to_api_repr () if policy_tags is not None else None
242238 if isinstance (range_element_type , str ):
243239 self ._properties ["rangeElementType" ] = {"type" : range_element_type }
244240 if isinstance (range_element_type , FieldElementType ):
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ def _reference_getter(table):
139139
140140# TODO: The typehinting for this needs work. Setting this pragma to temporarily
141141# manage a pytype issue that came up in another PR. See Issue: #2132
142- def _view_use_legacy_sql_getter (table ) :
142+ def _view_use_legacy_sql_getter (table : "Table" ) -> bool :
143143 """bool: Specifies whether to execute the view with Legacy or Standard SQL.
144144
145145 This boolean specifies whether to execute the view with Legacy SQL
@@ -151,10 +151,10 @@ def _view_use_legacy_sql_getter(table):
151151 ValueError: For invalid value types.
152152 """
153153
154- view = table ._properties .get ("view" ) # type: ignore
154+ view : Optional [ Dict [ str , Any ]] = table ._properties .get ("view" )
155155 if view is not None :
156156 # The server-side default for useLegacySql is True.
157- return view .get ("useLegacySql" , True ) # type: ignore
157+ return view .get ("useLegacySql" , True ) if view is not None else True
158158 # In some cases, such as in a table list no view object is present, but the
159159 # resource still represents a view. Use the type as a fallback.
160160 if table .table_type == "VIEW" :
You can’t perform that action at this time.
0 commit comments