Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

fix(alerts): ensure percent change is not flipped for neg. exp. vals #1145

Merged
merged 1 commit into from
Oct 3, 2022

Conversation

Samyak2
Copy link
Contributor

@Samyak2 Samyak2 commented Sep 30, 2022

When expected value was negative, the percent change would be in the opposite direction of what it should be.

Fixed by using absolute value of expected value in the denominator.

Tested on these cases:

  • Both positive: actual higher than expected
  • Both positive: actual lower than expected
  • Actual positive and expected negative
  • Actual negative and expected positive
  • Both negative: actual higher than expected
  • Both negative: actual lower than expected

When expected value was negative, the percent change would be in the
opposite direction of what it should be.

Fixed by using absolute value of expected value in the denominator.

Tested on these cases:
- Both positive: actual higher than expected
- Both positive: actual lower than expected
- Actual positive and expected negative
- Actual negative and expected positive
- Both negative: actual higher than expected
- Both negative: actual lower than expected
@Samyak2 Samyak2 added 🐛 bug Something isn't working 🛠️ backend ❗alerts Alert formatting, scheduling, etc. labels Sep 30, 2022
@Samyak2 Samyak2 added this to the v0.11.0 milestone Sep 30, 2022
@gitpod-io
Copy link

gitpod-io bot commented Sep 30, 2022

@netlify
Copy link

netlify bot commented Sep 30, 2022

Deploy Preview for frontend-sb ready!

Name Link
🔨 Latest commit efb10de
🔍 Latest deploy log https://app.netlify.com/sites/frontend-sb/deploys/6336fec18302670009316d5a
😎 Deploy Preview https://deploy-preview-1145--frontend-sb.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@Samyak2 Samyak2 modified the milestones: v0.11.0, v0.11.1 Oct 3, 2022
Copy link
Member

@Amatullah Amatullah left a comment

Choose a reason for hiding this comment

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

LGTM.

@Samyak2 Samyak2 merged commit d338e93 into develop Oct 3, 2022
@Samyak2 Samyak2 deleted the fix/percent-change-negative-expected branch October 3, 2022 06:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
❗alerts Alert formatting, scheduling, etc. 🛠️ backend 🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants