-
Notifications
You must be signed in to change notification settings - Fork 157
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
[ADAP-503] [Regression] Persisted Metadata does not update on BigQuery tables #687
Comments
Thanks for reporting this @patricker and @steve-marmalade. I was able to reproduce this when using |
Simple reprex
name: "my_dbt_project"
version: "1.0.0"
config-version: 2
profile: "sandcastle-bigquery"
models:
my_dbt_project:
+persist_docs:
relation: true
columns: true
# version isn't required for dbt-core 1.5, but it is for 1.4
version: 2
models:
- name: my_model
columns:
- name: id
description: Primary key
policy_tags:
# Example pattern:
# - 'projects/<gcp-project>/locations/<location>/taxonomies/<organization>/policyTags/<tag>'
- projects/dbt-test-env/locations/us/taxonomies/5785568062805976401/policyTags/135489647357012267
{{ config(materialized='table') }}
select 1 as id |
I've written a fix for this issue as above. It looks like this bug was introduced during this MR which attempts to remove policy tags from all columns and structs on the model. I wasn't able to reproduce it using the method that you described @dbeatty10 but I could produce it using the below setup:
name: "my_dbt_project"
version: "1.0.0"
config-version: 2
profile: "sandcastle-bigquery"
models:
my_dbt_project:
+persist_docs:
relation: true
columns: true
select
struct(
1 AS id
) as first_struct
version: 2
models:
- name: my_model
description: "A starter dbt model"
columns:
- name: first_struct
- name: first_struct.id It fails when trying to remove policy tags from the struct as defined in the yml which was introduced in the MR 542. You would want structs in the yml so you can apply descriptions to them in the model in BigQuery. |
Thanks for truly reproducing this @dgreen161 🙏 Once I looked more closely at the error I "reproduced", it was actually a 403 rather than a 400 😅 |
Hi @nssalian @dbeatty10 Do you have a timeline for when the backport will be accessible through pip and dbt Cloud? It looks like 1.5.0 was last released 3 weeks ago. I can see it's in the beta release but that still leaves 1.5 with the issue. Thanks |
@dgreen161 Thank you for checking-in! We just released the backport yesterday -- wanna give it shot? |
@dbeatty10 Thanks for the update, I've just run the new version (v1.5.1) locally and the issue has now gone |
Is this a new bug in dbt-core?
Current Behavior
After upgrading to dbt 1.5.0 column metadata does not update in BigQuery and the model build shows as failed.
Expected Behavior
metadata writes to the tables without issue in BigQuery.
Steps To Reproduce
+persist_docs:
relation: true
columns: true
Relevant log output
Error: google.api_core.exceptions.BadRequest: 400 PATCH https://bigquery.googleapis.com/bigquery/v2/projects/{table_path}?prettyPrint=false: Policy tags can only be attached to a leaf field.
Environment
Which database adapter are you using with dbt?
bigquery
Additional Context
I rolled back to 1.4.6 and the issue went away.
The text was updated successfully, but these errors were encountered: