AltimateAI / vscode-dbt-power-user

This extension makes vscode seamlessly work with dbt™: Auto-complete, preview, column lineage, AI docs generation, health checks, cost estimation etc
https://www.altimate.ai
MIT License
453 stars 87 forks source link

Documentation editor doesn't support doc function #569

Open HbirdJ opened 1 year ago

HbirdJ commented 1 year ago

Expected behavior

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

I would expect either one of the following to occur:

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?

septponf commented 3 months ago

fixing this would be great

anandgupta42 commented 2 months ago

related to https://github.com/AltimateAI/vscode-dbt-power-user/issues/726 and https://github.com/AltimateAI/vscode-dbt-power-user/issues/1131