From c377ccf7d644238e50fdec5453ddf3e517489bf4 Mon Sep 17 00:00:00 2001 From: Elizabeth Thompson Date: Wed, 27 Mar 2024 18:10:22 -0700 Subject: [PATCH] fix: reduce alert error to warning (#27744) (cherry picked from commit 70da454bbce107c624efda9535f50f7b3ce411b2) --- superset-frontend/src/components/Chart/chartAction.js | 2 +- superset-frontend/src/components/Chart/chartActions.test.js | 6 +++--- superset/commands/report/alert.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/components/Chart/chartAction.js b/superset-frontend/src/components/Chart/chartAction.js index 9e7f961abdf52..86e4b6b2a06c6 100644 --- a/superset-frontend/src/components/Chart/chartAction.js +++ b/superset-frontend/src/components/Chart/chartAction.js @@ -375,7 +375,7 @@ export function addChart(chart, key) { } export function handleChartDataResponse(response, json, useLegacyApi) { - if (isFeatureEnabled(FeatureFlag.GlobalAsyncQueries)) { + if (isFeatureEnabled(FeatureFlag.GLOBAL_ASYNC_QUERIES)) { // deal with getChartDataRequest transforming the response data const result = 'result' in json ? json.result : json; switch (response.status) { diff --git a/superset-frontend/src/components/Chart/chartActions.test.js b/superset-frontend/src/components/Chart/chartActions.test.js index c2a58e6094404..7babb7bbb2465 100644 --- a/superset-frontend/src/components/Chart/chartActions.test.js +++ b/superset-frontend/src/components/Chart/chartActions.test.js @@ -83,7 +83,7 @@ describe('chart actions', () => { waitForAsyncDataStub.restore(); global.featureFlags = { - [FeatureFlag.GlobalAsyncQueries]: false, + [FeatureFlag.GLOBAL_ASYNC_QUERIES]: false, }; }); @@ -136,7 +136,7 @@ describe('chart actions', () => { it('handleChartDataResponse should handle responses when GlobalAsyncQueries flag is enabled and results are returned synchronously', async () => { global.featureFlags = { - [FeatureFlag.GlobalAsyncQueries]: true, + [FeatureFlag.GLOBAL_ASYNC_QUERIES]: true, }; const result = await handleChartDataResponse( { status: 200 }, @@ -147,7 +147,7 @@ describe('chart actions', () => { it('handleChartDataResponse should handle responses when GlobalAsyncQueries flag is enabled and query is running asynchronously', async () => { global.featureFlags = { - [FeatureFlag.GlobalAsyncQueries]: true, + [FeatureFlag.GLOBAL_ASYNC_QUERIES]: true, }; const result = await handleChartDataResponse( { status: 202 }, diff --git a/superset/commands/report/alert.py b/superset/commands/report/alert.py index fc1be14e02049..2c707c21e1522 100644 --- a/superset/commands/report/alert.py +++ b/superset/commands/report/alert.py @@ -169,7 +169,7 @@ def _execute_query(self) -> pd.DataFrame: logger.warning("A timeout occurred while executing the alert query: %s", ex) raise AlertQueryTimeout() from ex except Exception as ex: - logger.exception("An error occurred when running alert query") + logger.warning("An error occurred when running alert query") # The exception message here can reveal to much information to malicious # users, so we raise a generic message. raise AlertQueryError(