The current v2 view materialization with an enabled view_update_via_alter uses ALTER VIEW to reflect changes of the view based on a changeset. When a query change is detected, the resulting ALTER VIEW <view> AS <query> command will wipe all column comments if provided via column_list via the view DDL. They are currently not being added back in.
Steps To Reproduce
- materialize the following
seed.csv:
- run the following view model with the schema.yaml:
{{
config(
materialized='view',
view_update_via_alter=True,
persist_docs={
"relation": True,
"columns": True,
},
)
}}
select id, msg from {{ ref('seed') }};
models:
- name: my_first_dbt_model
columns:
- name: id
description: "The primary key for this table"
- change the view sql definition and rerun the model, e.g.:
select 1 as id, msg from {{ ref('seed') }}
This will wipe the column comment for id and leave the view in an undocumented state.
Expected behavior
The column comments persist, even after a query update. This could be an additional query that adds all comments back in.
The current v2 view materialization with an enabled
view_update_via_alterusesALTER VIEWto reflect changes of the view based on a changeset. When a query change is detected, the resultingALTER VIEW <view> AS <query>command will wipe all column comments if provided via column_list via the view DDL. They are currently not being added back in.Steps To Reproduce
seed.csv:{{ config( materialized='view', view_update_via_alter=True, persist_docs={ "relation": True, "columns": True, }, ) }} select id, msg from {{ ref('seed') }};This will wipe the column comment for
idand leave the view in an undocumented state.Expected behavior
The column comments persist, even after a query update. This could be an additional query that adds all comments back in.