Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] dbt_coves/templates not working as expected #495

Open
davidggphy opened this issue Aug 29, 2024 · 3 comments
Open

[BUG] dbt_coves/templates not working as expected #495

davidggphy opened this issue Aug 29, 2024 · 3 comments
Labels
bug Something isn't working triaged: no Hasn't been approved for future implementation

Comments

@davidggphy
Copy link

Describe the bug
I created a custom model_props.ylm template, to ensure that all my models enforce the contract.

To Reproduce
Steps to reproduce the behaviour:

  1. Run command "dbt-coves generate templates"
  2. cd into the folder ".dbt_coves/templates/" and edit model_props.ylm
version: 2

models:
  - name: {{ model.lower() }}
    description: ""
    config:
      contract:
        enforced: true
    columns:
{%- for col in columns %}
      - name: {{ col['id'] }}
      {%- if col['description'] %}
        description: "{{ col['description'] }}"
      {%- endif %}
{%- endfor %}
  1. Run dbt-coves generate properties --templates-folder .dbt_coves/templates/ , select all models and "Update all"

Expected behaviour
A clear and concise description of what you expected to happen.

I would expect that all models would get the following extra lines:

    config:
      contract:
        enforced: true

Desktop (please complete the following information):

  • OS: macOS 14.6.1 (23G93)
  • dbt-coves Version: 1.8.0
@davidggphy davidggphy added the bug Something isn't working label Aug 29, 2024
@github-actions github-actions bot added the triaged: no Hasn't been approved for future implementation label Aug 29, 2024
@BAntonellini
Copy link
Collaborator

BAntonellini commented Aug 30, 2024

Hi @davidggphy, strategy update only updates columns and descriptions inside of models.

For the time being, I recommend you go for the recreate strategy, which will replace the "old" model with the "new" one entirely (recreate the property file with the new template result).

@davidggphy
Copy link
Author

Hey @BAntonellini , thanks for your response.

But does recreate keep the old information, such as descriptions, tests, etc?

@BAntonellini
Copy link
Collaborator

@davidggphy unfortunately no, any content that you added manually to the generated template would be lost if you go for recreate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged: no Hasn't been approved for future implementation
Projects
None yet
Development

No branches or pull requests

2 participants