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

Alert evaluation bugfix + add average selector to alerts #7098

Closed
wants to merge 3 commits into from

Conversation

ezraodio1
Copy link
Contributor

@ezraodio1 ezraodio1 commented Aug 1, 2024

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • New Query Runner (Data Source)
  • New Alert Destination
  • Other

Description

This is an addition to #7076. This PR adds the ability to select the average value from a column when making an alert.

This PR also makes the alert evaluate to UNKNOWN when min, max, or avg cannot be computed for a column. For example, this will happen when the column data type is a string, and those strings can't be converted to numbers.

This PR also deletes a print statement that was accidentally left in #7076.

How is this tested?

  • Unit tests (pytest, jest)
  • E2E Tests (Cypress)
  • Manually
  • N/A

Related Tickets & Documents

#7076

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

client/app/components/proptypes.js Outdated Show resolved Hide resolved
client/app/pages/alert/components/Criteria.jsx Outdated Show resolved Hide resolved
@ezraodio1 ezraodio1 force-pushed the alert-average-selector branch 2 times, most recently from 406cbe6 to 704b7d8 Compare August 1, 2024 18:06
@ezraodio1 ezraodio1 changed the title Add average selector to alerts Alert evaluation bugfix + add average selector to alerts Aug 1, 2024
redash/models/__init__.py Outdated Show resolved Hide resolved
Restyled by prettier

Evaluate alerts as unknown when you cannot evaluate min, max or avg
@ezraodio1 ezraodio1 force-pushed the alert-average-selector branch from 704b7d8 to fbb447e Compare August 1, 2024 19:52
Copy link
Collaborator

@eradman eradman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ezraodio1 can you submit the bug fixes as a separate PR? I may not be able to review this feature for another week or so

@ezraodio1
Copy link
Contributor Author

@ezraodio1 can you submit the bug fixes as a separate PR? I may not be able to review this feature for another week or so

Done. The bug fix part is in #7103. Once that fix is implemented, I'll change this PR so that it only adds the ability to calculate the average.

@ezraodio1 ezraodio1 closed this Aug 6, 2024
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.

4 participants