mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
Only evaluate the next state if there's a value (#7222)
I've experience this on my Redash in production. I'm not sure what can cause the value to exist, but be None. I guess it depends on the SQL query. I followed the same idea of returning a self.UNKNOWN_STATE for cases that we can't know what's happening.
This commit is contained in:
@@ -118,6 +118,10 @@ class TestAlertEvaluate(BaseTestCase):
|
||||
)
|
||||
self.assertEqual(alert.evaluate(), Alert.UNKNOWN_STATE)
|
||||
|
||||
def test_evaluate_return_unknown_when_value_is_none(self):
|
||||
alert = self.create_alert(get_results(None))
|
||||
self.assertEqual(alert.evaluate(), Alert.UNKNOWN_STATE)
|
||||
|
||||
|
||||
class TestNextState(TestCase):
|
||||
def test_numeric_value(self):
|
||||
|
||||
Reference in New Issue
Block a user