JasonD28 opened a new issue #10788:
URL: https://github.com/apache/incubator-superset/issues/10788


   When creating and triggering a SQL-based alert the values stored in the 
alert observations are rounded to a high degree. Starting at numbers in the:
    - 100,000s → rounded to the nearest 1s place
    - 1,000,000 → rounded to the nearest 10s place
    - 10,000,000 → rounded to the nearest 100s place
    - ... etc
   
   
   ### Expected results
   
   "List Observations" tab for an alert to hold values that accurately reflect 
the value returned from the SQL query in the alert's SQLObserver object.
   
   ### Actual results
   
   Values in the "List Observations" tab differ from the values returned by the 
associated SQL query due to rounding.
   
   #### Screenshots
   
   Seen in the List Observations tab of an alert:
   ![Screen Shot 2020-09-03 at 3 28 34 
PM](https://user-images.githubusercontent.com/32852580/92179731-249b8400-edfa-11ea-9401-cc79fe970a62.png)
   The correct value returned from the alert's SQL query was 711960960
   
   #### How to reproduce the bug
   
   1. set up config.py to enable alerting
   ```
   ENABLE_ALERTS = True
   FEATURE_FLAGS = {"THUMBNAILS": True}
   
   THUMBNAIL_SELENIUM_USER = "Admin"
   celery_alerting = {'alerts.schedule_check': {
           'task': 'alerts.schedule_check',
           'schedule': crontab(minute='*/1'),
       }}
   CeleryConfig.CELERYBEAT_SCHEDULE.update(celery_alerting)
   CELERY_CONFIG = CeleryConfig
   ```
   2. Go to Settings -> Alerts
   3. Create an alert
   4. Edit the alert and create a SQLObserver
       - a simple SQL query like `SELECT 1234567` or any bigger number will work
   5. Go back to the "Details" tab of the alert and click "Send Test Alert"
   6. Save Alert
   7. Click magnifying glass next to alert to view details
   8. Go to "List Observations"
   
   ### Environment
   
   (please complete the following information):
   
   - superset version: 0.37
   - python version: 3.7.7
   
   ### Checklist
   
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [x] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version 
of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't 
found one similar.
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to