' dbt文档生成'不会在目录中填充模型列级注释
我将DBT-SnowFlake 1.1.0与相应的DBT核1.1.0使用。
我在YAML文件中添加了模型的文档,即:
>模型/stage/docs.yml
version: 2
models:
- name: raw_weblogs
description: Web logs of customer interaction, broken down by attribute (bronze). The breakdown is performed using regular expressions.
columns:
- name: ip
description: IP address from which the request reached the server (might be direct customer IP or the address of a VPN/proxy).
...
尽管这些细节在dbt中正确显示ui 当我运行dbt docs生成
,然后dbt文档服务
,但它们尚未在target/catalog.json
中列出。
cat target/catalog.json | grep identity
(no results)
根据 dbt文档,我知道列注释应该是<代码> catalog.json 。
稍后编辑:我尝试运行dbt -debug docs生成
,看来所有数据直接从目标环境中检索(在我的情况下为雪花)。看着我在Snowflake中的模型的柱子,它们确实没有在雪花上发布任何评论。
在我看来,潜在的错误可能是dbt Run
无法正确地将列元数据持续到雪花上。
I use dbt-snowflake 1.1.0 with the corresponding dbt-core 1.1.0.
I added documentation for my models in yaml files, i.e.:
> models/stage/docs.yml
version: 2
models:
- name: raw_weblogs
description: Web logs of customer interaction, broken down by attribute (bronze). The breakdown is performed using regular expressions.
columns:
- name: ip
description: IP address from which the request reached the server (might be direct customer IP or the address of a VPN/proxy).
...
Although these details show up correctly in the DBT UI when i run dbt docs generate
and then dbt docs serve
, yet they are not listed in target/catalog.json
:
cat target/catalog.json | grep identity
(no results)
According to the DBT documentation, I understand that column comments should be part of catalog.json
.
LATER EDIT: I tried running dbt --debug docs generate
and it seems that all data is retrieved directly from the target environment (in my case, Snowflake). Looking at the columns of my model in Snowflake, they indeed do NOT have any comments posted on the in Snowflake.
It thus seems to me that the underlying error might be with the fact that dbt run
does not correctly persist the column metadata to Snowflake.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过进一步调查,我发现缺乏评论的原因确实是一个事实,即在运行
catalog.json
运行dbt docs生成
的事实是根据收到的数据库,而dbt文档服务
通过将来自catalog.json
的信息与元数据(在我的情况下,是记录的列注释)结合到本地DBT模型中,从而填充了UI。使用
dbt Run
在数据库中坚持此类元数据的解决方案是添加以下DBT配置:&gt; dbt_project.yml
After further investigation, I found out the reason for lacking comments was indeed the fact that the comments are written to
catalog.json
when runningdbt docs generate
based on what is received from the database, whiledbt docs serve
populates the UI by combining information fromcatalog.json
with metadata (in my case, documented column comments) from the local dbt models.The solution to persist such metadata in the database with
dbt run
was to add the following DBT configuration:> dbt_project.yml