-
Notifications
You must be signed in to change notification settings - Fork 316
Fix: Update type hints for various BigQuery files #2206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -518,23 +518,17 @@ def __init__(self): | |
@property | ||
def project(self): | ||
"""str: ID of the project containing the routine.""" | ||
# TODO: The typehinting for this needs work. Setting this pragma to temporarily | ||
# manage a pytype issue that came up in another PR. See Issue: #2132 | ||
return self._properties["projectId"] # pytype: disable=typed-dict-error | ||
return self._properties.get("projectId", "") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these be optional / return none as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of these (
If we used Whereas with an empty string we would get: |
||
|
||
@property | ||
def dataset_id(self): | ||
"""str: ID of dataset containing the routine.""" | ||
# TODO: The typehinting for this needs work. Setting this pragma to temporarily | ||
# manage a pytype issue that came up in another PR. See Issue: #2132 | ||
return self._properties["datasetId"] # pytype: disable=typed-dict-error | ||
return self._properties.get("datasetId", "") | ||
|
||
@property | ||
def routine_id(self): | ||
"""str: The routine ID.""" | ||
# TODO: The typehinting for this needs work. Setting this pragma to temporarily | ||
# manage a pytype issue that came up in another PR. See Issue: #2132 | ||
return self._properties["routineId"] # pytype: disable=typed-dict-error | ||
return self._properties.get("routineId", "") | ||
|
||
@property | ||
def path(self): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be Optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this method call has a default value:
If you call
.get()
you will get back theschema
dict OR you will get back an emptydict
, so I don't thinkOptional
applies here.