Skip to content

Documentation editor doesn't support doc function #569

Open
@HbirdJ

Description

@HbirdJ

Expected behavior

The doc jinja function is not cleanly supported by the documentation editor.

I would expect either one of the following to occur:

  • The docs jinja code block shows up in the documentation editor
  • Editing and saving the docs block updates the source definition of the doc

Actual behavior

The documentation editor correctly retrieves the docs block, but overwrites the doc function call when documentation is saved.

Steps To Reproduce

_docs.md:

{% docs time %}
UTC timestamp of the data point. Format is 'YYYY-MM-DD hh:mm:ss[.6_digit_fraction]'
{% enddocs %}

_models.yml:

  - name: model_name
    description: "model description"
    columns:
      - name: time
        description: '{{ doc("time") }}'

After clicking Save documentation button, the docs function is overwritten:

_models.yml:

  - name: model_name
    description: "model description"
    columns:
      - name: time
        description: UTC timestamp of the data point. Format is 'YYYY-MM-DD
          hh:mm:ss[.6_digit_fraction]'

Log output/Screenshots

The docs block displays the core docs value in the documentation editor.

image

Operating System

ubuntu 22.04

dbt version

1.5.4

dbt Adapter

BigQuery

dbt Power User version

0.17.5

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions