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] Email notification for multiple failed test is sent multiple times for multi failed tests per owner #363

Open
FrankTub opened this issue Oct 6, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@FrankTub
Copy link
Contributor

FrankTub commented Oct 6, 2022

Describe the bug

We use re_data to alert users through email notifications of failed tests. In our setup it is possible that the same owner is responsible for different models. If more than one model fails that is owned by the same owner, this owner will receive the same email the number of times the different model has failed tests. In a single mail all the different models are mentioned with the number of failed tests on them. But this mail is thus repeated several times.

Expected behavior

We would expect either a single mail for all the different models per owner. OR a mail per model that has failed per owner.

To Reproduce

Create model A & B something like.

select 1 as id

Create for both models a schema.yml:

version: 2

models:
  - name: A|B
    description: Test table
    config:
      re_data_owners:
        - owner
    tests:
      - dbt_utils.expression_is_true:
          name: "assertion_A"
          expression: "id = 0"

Set the owner in your dbt_project.yml:

  re_data:owners_config:
    owner:
      - type: email
        identifier: <your-mail>
        name: <Your Name>

Configure your email setup in ~/.re_data/re_data.yml:

notifications:
  email:
    mail_from: <your-mail>
    smtp_host: <your-host>
    smtp_port: <your-port>
    smtp_user: <your-user>
    smtp_password: <your-password>
    use_ssl: false
    use_tls: true

Then run the following bash commands in your dbt project.

dbt run --exclude re_data
dbt test
re_data overview generate
re_data notify email --select test

Screenshots

image

Logs and additional context

https://re-data.slack.com/files/U03KE7WF3EX/F04533QDQUE/monitored.json?origin_team=T01FUT83076&origin_channel=D0459D96V51

https://re-data.slack.com/files/U03KE7WF3EX/F0456P4LTBP/alerts.json?origin_team=T01FUT83076&origin_channel=D0459D96V51

@FrankTub FrankTub added the bug Something isn't working label Oct 6, 2022
@FrankTub FrankTub changed the title [BUG] [BUG] Email notification for multiple failed test is sent multiple times for multi failed tests per owner Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants