-
Notifications
You must be signed in to change notification settings - Fork 322
Closed
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
To make mypy happy when I have an optional job_config, I'm having to write code like this:
if job_config is not None:
query_job = self.bqclient.query(sql, job_config=job_config)
else:
query_job = self.bqclient.query(sql)This if/else should be unnecessary, but mypy complains that job_config argument to query can't be None.
The root cause is that the type annotation is only QueryJobConfig
python-bigquery/google/cloud/bigquery/client.py
Line 3274 in 130450a
| job_config: QueryJobConfig = None, |
It should be Optional[QueryJobConfig].
This same issue occurs in copy_table and extract_table.
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.