You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/10/09 20:42:05 UTC

[GitHub] [incubator-superset] bkyryliuk commented on a change in pull request #11179: chore: simplify alerting data model to leverage a single class

bkyryliuk commented on a change in pull request #11179:
URL: https://github.com/apache/incubator-superset/pull/11179#discussion_r502661870



##########
File path: tests/alerts_tests.py
##########
@@ -165,41 +148,38 @@ def test_alert_observer(setup_database):
             WHERE first = 1
         """,
     )
-    observe(alert8.id, dbsession)
-    assert alert8.sql_observer[0].observations[-1].value == 1.0
-    assert alert8.sql_observer[0].observations[-1].error_msg is None
+    observe(alert8.id, db_session)
+    assert alert8.observations[-1].value == 1.0
+    assert alert8.observations[-1].error_msg is None
 
     # Test jinja
-    alert9 = create_alert(dbsession, "SELECT {{ 2 }}")
-    observe(alert9.id, dbsession)
-    assert alert9.sql_observer[0].observations[-1].value == 2.0
-    assert alert9.sql_observer[0].observations[-1].error_msg is None
+    alert9 = create_alert(db_session, "SELECT {{ 2 }}")
+    observe(alert9.id, db_session)
+    assert alert9.observations[-1].value == 2.0
+    assert alert9.observations[-1].error_msg is None
 
 
 @patch("superset.tasks.schedules.deliver_alert")
 def test_evaluate_alert(mock_deliver_alert, setup_database):
-    dbsession = setup_database
+    db_session = setup_database

Review comment:
       yes !




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org