From 3ec7d017ffa10860ca5f75adb130099bfbdf9bc9 Mon Sep 17 00:00:00 2001 From: bogdan kyryliuk Date: Wed, 29 Apr 2020 14:46:29 -0700 Subject: [PATCH] Catch db_engine_spec.get_function_names exceptions --- superset/models/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/superset/models/core.py b/superset/models/core.py index 10609860e9903..94383c87d3814 100755 --- a/superset/models/core.py +++ b/superset/models/core.py @@ -165,7 +165,13 @@ def allows_subquery(self) -> bool: @property def function_names(self) -> List[str]: - return self.db_engine_spec.get_function_names(self) + try: + return self.db_engine_spec.get_function_names(self) + except Exception as ex: # pylint: disable=broad-except + # function_names property is used in bulk APIs and should not hard crash + # more info in: https://github.com/apache/incubator-superset/issues/9678 + logger.error(f"Failed to fetch database function names with error: {ex}") + return [] @property def allows_cost_estimate(self) -> bool: