【问题标题】:render doc in exposures description in dbt在 dbt 中的暴露描述中渲染文档
【发布时间】:2021-09-05 05:51:01
【问题描述】:

我在models文件夹下的sources.yml文件下写了曝光

exposures:
  - name: data_sources
    description: '{{ doc("orders_status") }}'
    type: dashboard
    url: urlname
  
    owner:
      name: name
      email: mailid

我在models文件夹下也有docs.md

{% docs orders_status %}

Orders can be one of the following statuses:

| status         | description                                                               |
|----------------|---------------------------------------------------------------------------|
| placed         | The order has been placed but has not yet left the warehouse              |
| shipped        | The order has ben shipped to the customer and is currently in transit     |
| completed      | The order has been received by the customer                               |
| returned       | The order has been returned by the customer and received at the warehouse |


{% enddocs %}

当我执行 dbt 文档生成时,我得到了

Encountered an error:
Compilation Error
  Failed to render models\sources.yml from project cemd_transformations: Compilation Error
    Could not render {{ doc("orders_status") }}: 'doc' is undefined 

还有什么我应该包括的东西才能让它工作吗?

【问题讨论】:

    标签: dbt


    【解决方案1】:

    这是一个已知问题,已在 v0.19.0 中得到修复。所以,如果可能的话,我建议你升级你的 dbt 版本。

    文档中有关于如何做到这一点的主题:

    https://docs.getdbt.com/dbt-cli/installation

    此外,还有一份迁移指南,他们在其中指出了一些重大更改。他们不认为这些在大多数项目中都需要采取行动,但重要的是要意识到这一点:

    https://docs.getdbt.com/docs/guides/migration-guide/upgrading-to-0-19-0

    已解决的问题

    https://github.com/fishtown-analytics/dbt/issues/3030

    https://github.com/fishtown-analytics/dbt/issues/2913

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-12-22
      • 2011-11-19
      • 1970-01-01
      • 2018-01-03
      • 2011-11-22
      • 1970-01-01
      • 2017-08-23
      相关资源
      最近更新 更多