Skip to content
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

add ability to unset policy tags (and description?) in schema fields #558

Closed
tswast opened this issue Mar 18, 2021 · 2 comments · Fixed by #703
Closed

add ability to unset policy tags (and description?) in schema fields #558

tswast opened this issue Mar 18, 2021 · 2 comments · Fixed by #703
Assignees
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@tswast
Copy link
Contributor

tswast commented Mar 18, 2021

Is your feature request related to a problem? Please describe.

I noticed in #557 that we don't send the policy tags property if none are set in SchemaField. I believe this tells the backend not to make any updates to the policy tags property. This means it's not possible to unset policy tags from Python.

(Note: I haven't verified this, so some system tests / samples should be written for this use case)

Describe the solution you'd like

Similar to what I did for description in #557, we should disambiguate between unset policy tags and empty / none for policy tags.

Describe alternatives you've considered

We could make the update fields property more fine-grained, such as schema.policytags in order to force a sub-property to be included. This feels overly complicated, though.

Additional context

N/A

@tswast tswast added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Mar 18, 2021
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Mar 18, 2021
@tswast
Copy link
Contributor Author

tswast commented Mar 18, 2021

Since SchemaField is read-only, we could also make the change to use _properties for all properties without making breaking changes, which would align it with our other resource classes.

@plamut
Copy link
Contributor

plamut commented Jun 15, 2021

I noticed in #557 that we don't send the policy tags property if none are set in SchemaField. I believe this tells the backend not to make any updates to the policy tags property. This means it's not possible to unset policy tags from Python.

(Note: I haven't verified this, so some system tests / samples should be written for this use case)

I tried it and if schema_field.policy_tags is set from "something" to None, it is simply omitted from the API representation, meaning that policy tags indeed not get unset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants