Skip to content

Fix alert evaluation logic and issue with calculating min and max for alerts #7103

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

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

ezraodio1
Copy link
Contributor

What type of PR is this?

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

Description

Currently, if op(value, threshold) is not True, the alert evaluates to OK_STATE. This happens in situations where you have op = <, value = "test", and threshold = 4. Since this isn't a logical evaluation, I propose that we evaluate the alert to UNKNOWN_STATE in situations like these.

Additionally, when calculating the minimum and maximum of a column, there is no check for whether the column values are numbers. This PR adds that check in and evaluates the alert to UNKNOWN_STATE if the data in the column cannot be converted to numbers (meaning we can't logically evaluate the minimum or maximum of the column).

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)

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.

This looks right, and seems to check out in testing

@eradman eradman enabled auto-merge (squash) August 5, 2024 14:17
@eradman eradman force-pushed the bugfix-alert-evaluate branch from 05416d9 to e44fcdb Compare August 5, 2024 14:17
@eradman eradman merged commit 51ef625 into getredash:master Aug 5, 2024
11 checks passed
harveyrendell pushed a commit to pushpay/redash that referenced this pull request Jan 8, 2025
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.

2 participants