mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(alerts): wrong alert trigger with custom query (#35871)
This commit is contained in:
committed by
GitHub
parent
861e5cd013
commit
5edaed2e5b
@@ -131,7 +131,9 @@ def test_execute_query_mutate_query_enabled(
|
||||
database=mock_database,
|
||||
validator_config_json='{"op": "==", "threshold": 1}',
|
||||
)
|
||||
AlertCommand(report_schedule=report_schedule, execution_id=uuid.uuid4()).run()
|
||||
triggered, message = AlertCommand(
|
||||
report_schedule=report_schedule, execution_id=uuid.uuid4()
|
||||
).run()
|
||||
|
||||
mock_mutate_call.assert_called_once_with(mock_limited_sql.return_value)
|
||||
mock_get_df.assert_called_once_with(sql=mock_mutate_call.return_value)
|
||||
@@ -166,7 +168,9 @@ def test_execute_query_mutate_query_disabled(
|
||||
database=mock_database,
|
||||
validator_config_json='{"op": "==", "threshold": 1}',
|
||||
)
|
||||
AlertCommand(report_schedule=report_schedule, execution_id=uuid.uuid4()).run()
|
||||
triggered, message = AlertCommand(
|
||||
report_schedule=report_schedule, execution_id=uuid.uuid4()
|
||||
).run()
|
||||
|
||||
mock_database.mutate_sql_based_on_config.assert_not_called()
|
||||
mock_database.get_df.assert_called_once_with(
|
||||
|
||||
Reference in New Issue
Block a user