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

[Bug] Description from schema.yml is not used for materialized view for BigQuery. #1374

Open
2 tasks done
KevinCharette opened this issue Oct 17, 2024 · 5 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@KevinCharette
Copy link

Is this a new bug in dbt-bigquery?

  • I believe this is a new bug in dbt-bigquery
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

The description field in the schema.yml is not used to update the table description in BigQuery. The description of the table in BigQuery is left to empty.

Interestingly, adding the description in the sql model is working.

{{
    config(
        materialized='materialized_view',
        description='Super description'
   )
}}

Expected Behavior

The table description in the schema.yml should be pushed to and updated in BigQuery

Steps To Reproduce

  1. Create a sql model using materialized='materialized_view' as option.
  2. Add a schema.yml with a description
  3. run dbt run -s your_model
  4. Notice that the description in left blank in BigQuery

Relevant log output

No response

Environment

- OS:14.6.1 (23G93)
- Python:3.11.1
- dbt-core: 1.8.0
- dbt-bigquery: 1.8.0

Additional Context

Quick investigation:
It looks like the issue is coming from here

The description coming from the schema.yml is under relation_config.description but the code is using relation_config.config.extra.get(option)

When I inspect relation_config.config.extra I only see the description field that is provided in the SQL model file using something like this:

{{
    config(
        materialized='materialized_view',
        description='Super description'
   )
}}
@KevinCharette KevinCharette added bug Something isn't working triage labels Oct 17, 2024
@amychen1776
Copy link

amychen1776 commented Oct 25, 2024

@KevinCharette have you enabled persist_docs and I wanted to make sure, does this work in an schema.yml file (not on the model config?)

@KevinCharette
Copy link
Author

👋 @amychen1776,

have you enabled persist_docs. Yes it is enabled by default in our dbt/dbt_project.yml

I'm confused about this question

does this work in an schema.yml file (not on the model config?)

What do you mean exactly? If you are asking wether we can add the description in the schema.yml, no it does not work (this is the base of the issue).

@amychen1776
Copy link

amychen1776 commented Oct 28, 2024

@KevinCharette In order to apply the description from your configuration to the warehouse, you need to have persist_docs set to True. Have you done this in your project?

Your example shows the description in a model configuration but not on an YAML file so I wanted to make sure. You can apply descriptions on a project.yml, model config block, and an property file (which is a yml file)

@KevinCharette
Copy link
Author

In order to apply the description from your configuration to the warehouse, you need to have persist_docs set to True. Have you done this in your project?

Yes. It is done in our dbt/dbt_project.yml

Your example shows the description in a model configuration but not on an YAML file so I wanted to make sure. You can apply descriptions on a project.yml, model config block, and an property file (which is a yml file)

Got it.

@amychen1776
Copy link

amychen1776 commented Oct 28, 2024

Thank you for the confirmation! This appears to be a bug then and we will scope it out for timing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants