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

[Wilt Chamberlain] Render severity config for tests #1511

Closed
drewbanin opened this issue Jun 6, 2019 · 1 comment · Fixed by #1519
Closed

[Wilt Chamberlain] Render severity config for tests #1511

drewbanin opened this issue Jun 6, 2019 · 1 comment · Fixed by #1519

Comments

@drewbanin
Copy link
Contributor

Feature

Feature description

As of 0.14.0, test severity can be configured with a syntax like:

version: 2

models:
  - name: my_models
    columns:
       - name: id
          tests:
            - unique:
                 severity: error

If possible, we should consider rendering the severity field with a macro context. This would make it possible to implement complex test logic in an environment-aware way. Eg:

version: 2

models:
  - name: my_models
    columns:
       - name: id
          tests:
            - unique:
                 severity: "{{ 'error' if var('strict', false) else 'warn' }}"

Conceivably, users could put logic like this into macros, then use those macros in their severity specifications.

We've spoken about what ends up in the rendering context in #1255, so if this is mired in some larger conversation about the conversation context, then we can tackle this in a future release. If it's straightforward to implement now, I think it would be a great addition to the Wilt Chamberlain release of dbt.

@drewbanin drewbanin added this to the Wilt Chamberlain milestone Jun 6, 2019
@drewbanin
Copy link
Contributor Author

Desired context (global):

  • target
  • CLI vars
  • modules
  • run started at / invocation_id

beckjake added a commit that referenced this issue Jun 13, 2019
…ity-configs

render severity configurations (#1512) (#1511)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant