# Update existing table descriptions in BQ from dbt

**URL:** <https://discourse.getdbt.com/t/update-existing-table-descriptions-in-bq-from-dbt/12501>\
**Category:** Help\
**Tags:** bigquery\
**Created:** [March 15, 2024, 1:00pm UTC](https://discourse.getdbt.com/t/update-existing-table-descriptions-in-bq-from-dbt/12501 "2024-03-15T13:00:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MustafaSaltik](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/mustafasaltik/32/3081_2.png) [@MustafaSaltik](https://discourse.getdbt.com/u/MustafaSaltik)\
**Post date:** [March 15, 2024, 1:00pm UTC](https://discourse.getdbt.com/t/update-existing-table-descriptions-in-bq-from-dbt/12501/1 "2024-03-15T13:00:53Z")

</div>

I have enabled persist\_docs in dbt\_project.yml and provided table/column descriptions in schema.yml files. It’s able to update column descriptions but not working for already existing tables. It puts table descriptions when only table is created. How can I update table descriptions for already existing tables?

Thanks!

dbt\_project.yml

```auto
models:
  +persist_docs:
    relation: true
    columns: true

```

---

<div class="post-metadata">

**Author:** ![a\_slack\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/a_slack_user/32/1629_2.png) [@a\_slack\_user](https://discourse.getdbt.com/u/a_slack_user)\
**Post date:** [March 15, 2024, 1:04pm UTC](https://discourse.getdbt.com/t/update-existing-table-descriptions-in-bq-from-dbt/12501/2 "2024-03-15T13:04:52Z")

</div>

This is correct, that’s just how it works. Hopefully your database has an API you can use?

Note: `@Mike Stanley` originally [posted this reply in Slack](https://getdbt.slack.com/archives/CBSQTAPLG/p1710507885565259?thread_ts=1710507677.918399&cid=CBSQTAPLG). It might not have transferred perfectly.

---

<div class="post-metadata">

**Author:** ![a\_slack\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/a_slack_user/32/1629_2.png) [@a\_slack\_user](https://discourse.getdbt.com/u/a_slack_user)\
**Post date:** [March 15, 2024, 1:56pm UTC](https://discourse.getdbt.com/t/update-existing-table-descriptions-in-bq-from-dbt/12501/3 "2024-03-15T13:56:21Z")

</div>

Thanks for the response. Yes there are other options I will check.

Note: `@mustafasaltikk` originally [posted this reply in Slack](https://getdbt.slack.com/archives/CBSQTAPLG/p1710510973874299?thread_ts=1710507677.918399&cid=CBSQTAPLG). It might not have transferred perfectly.

---

<div class="post-metadata">

**Author:** ![a\_slack\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/a_slack_user/32/1629_2.png) [@a\_slack\_user](https://discourse.getdbt.com/u/a_slack_user)\
**Post date:** [March 15, 2024, 2:53pm UTC](https://discourse.getdbt.com/t/update-existing-table-descriptions-in-bq-from-dbt/12501/4 "2024-03-15T14:53:21Z")

</div>

thanks for posting this, i asked the exact same question a little over 12 hours ago and didn’t get a response.

in my case, i tried doing `ALTER TABLE my_table ALTER COLUMN my_column SET OPTIONS(description=“my_description”);` directly in the GCP console and it worked on my existing incremental tables. so i think i will just write a little python script in colab to loop through all my .yml files and run that SQL.

i’m genuinely curious why dbt doesn’t just run the same SQL for `persist_docs`. if there are at least two of us who expected that behavior then i’m sure we’re not the only ones.

Note: `@LKG` originally [posted this reply in Slack](https://getdbt.slack.com/archives/CBSQTAPLG/p1710514394659319?thread_ts=1710507677.918399&cid=CBSQTAPLG). It might not have transferred perfectly.

---

<div class="post-metadata">

**Author:** ![a\_slack\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/a_slack_user/32/1629_2.png) [@a\_slack\_user](https://discourse.getdbt.com/u/a_slack_user)\
**Post date:** [March 15, 2024, 3:05pm UTC](https://discourse.getdbt.com/t/update-existing-table-descriptions-in-bq-from-dbt/12501/5 "2024-03-15T15:05:43Z")

</div>

The adapter could probably be modified to do this, but the simple answer is that it doesn’t amend the table unless it’s full-refreshing. I think it’s related to the way on\_schema\_change is handled.

If I were going to change it I’d go take a look at the adapter’s code and figure out when and how it does the update - it can presumably be changed to run on every dbt run

Note: `@Mike Stanley` originally [posted this reply in Slack](https://getdbt.slack.com/archives/CBSQTAPLG/p1710515135317629?thread_ts=1710507677.918399&cid=CBSQTAPLG). It might not have transferred perfectly.

---

<div class="post-metadata">

**Author:** ![a\_slack\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/a_slack_user/32/1629_2.png) [@a\_slack\_user](https://discourse.getdbt.com/u/a_slack_user)\
**Post date:** [March 15, 2024, 3:22pm UTC](https://discourse.getdbt.com/t/update-existing-table-descriptions-in-bq-from-dbt/12501/6 "2024-03-15T15:22:29Z")

</div>

oh, interesting! i have `on_schema_change='fail'`, i had tried the full refresh to see if it would update, but it only updated the table-level description and not the columns. i’ll try temporarily removing the `on_schema_change` config and see if that updates the columns with the full refresh.

i did poke around github for a while last night and found this, but haven’t dug any deeper yet: [https://github.com/dbt-labs/dbt-bigquery/blob/6c0afe4cfb69761dada5d16150fe632b8f72bf39/dbt/adapters/bigquery/impl.py#L609|https://github.com/dbt-labs/dbt-bigquery/blob/6c0afe4cfb69761dada5d16150fe632b8f72bf39/dbt/adapters/bigquery/impl.py#L609](https://github.com/dbt-labs/dbt-bigquery/blob/6c0afe4cfb69761dada5d16150fe632b8f72bf39/dbt/adapters/bigquery/impl.py#L609%7Chttps://github.com/dbt-labs/dbt-bigquery/blob/6c0afe4cfb69761dada5d16150fe632b8f72bf39/dbt/adapters/bigquery/impl.py#L609)

Note: `@LKG` originally [posted this reply in Slack](https://getdbt.slack.com/archives/CBSQTAPLG/p1710516141043739?thread_ts=1710507677.918399&cid=CBSQTAPLG). It might not have transferred perfectly.
