-
Notifications
You must be signed in to change notification settings - Fork 306
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
fix: handle case when expirationMs is None #1553
fix: handle case when expirationMs is None #1553
Conversation
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.
Thanks @abdelmegahed
Could you write a unit test covering this case? I'd expect one similar to https://github.com/googleapis/python-bigquery/blob/main/tests/unit/test_table.py#L1178 test_to_api_repr_w_custom_field
perhaps called test_to_api_repr_w_unsetting_expiration
@tswast test added. Thanks for the pointers :) |
Right now, unsetting
['timePartitioning']['expirationMs']
on BigQuery table is not supported and raisesgoogle.api_core.exceptions.BadRequest: 400 PATCH https://bigquery.googleapis.com/bigquery/v2/projects/abdelrahmanm-bd-dev/datasets/partition_expiry_test/tables/sample_data_partitioned?prettyPrint=false: Invalid value at 'table.time_partitioning.expiration_ms.value' (TYPE_INT64), "None"
This happens since the backend doesn't treat "None" (string) as a null. This PR addresses this issue from the client side.
Sample code that fails with the above exception: