-
Notifications
You must be signed in to change notification settings - Fork 324
Open
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.
Description
Unlike many of the other enumerations defined in google/cloud/bigquery/enums.py, WriteDisposition derives from object, not enum.Enum and therefore WriteDisposition can't easily be used as a type annotation in method args where you want to set a default disposition.
Environment details
- OS type and version: macOS 15.7.3
- Python version: 3.13.2
- pip version: 25.3
google-cloud-bigqueryversion: 3.40.0
Steps to reproduce
- Define a function which simplifies calls to BQ and takes a WriteDisposition as a parameter
- Set a default value for the WriteDisposition parameter
- Fail to type check with
ty
Code example
Something like:
def write_to_bq(write_type: WriteDisposition = WriteDisposition.WRITE_APPEND)Results in an [invalid-argument] type checking error from ty with a message like:
Expected `WriteDisposition`, found `Unknown | Literal["WRITE_APPEND"]`
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.Issues related to the googleapis/python-bigquery API.