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

add re_data_anomalies_filtered as var #116

Merged
merged 4 commits into from
Nov 23, 2023
Merged

Conversation

suelai
Copy link
Contributor

@suelai suelai commented Aug 28, 2023

What

closes re-data/re-data#403

How

Add a var for re_data_anomalies_filtered that can override the alerts. In this way, you can select from re_data_anomalies what anomalies you would like to show in alerts in the UI, and also notify in slack.

After this change, the user can create a model (view, ephemeral, table, anything works) on top of re_data_anomalies, for example, the view anomaly_filters

 SELECT
        *
    FROM
        {{ ref('re_data_anomalies') }}
    WHERE
        table_name LIKE '%my_test_table%'
        AND column_name = 'age'
        AND metric = 'avg'

Then set up re_data:re_data_anomalies_filtered: anomaly_filtersindbt.project.yml` and that is all.


Tried it on my current project by loading

packages:  
  - git: https://github.com/suelai/dbt-re-data.git
    revision: b1c137c6bd807e06002b7bba1699a0a05deff8ff

and then set up re_data:re_data_anomalies_filtered: anomaly_filters in my dbt_project.yml where anomaly_filters is an ephemeral model on top of re_data_anomalies
It worked as expected and re_data_alerts is now filtered on anomaly_filters

@suelai suelai marked this pull request as ready for review August 28, 2023 08:51
@davidzajac1 davidzajac1 merged commit b3db48b into re-data:main Nov 23, 2023
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 this pull request may close these issues.

[FEATURE]
2 participants