fix: Catch db_engine_spec.get_function_names exceptions (#9691)

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
This commit is contained in:
Bogdan
2020-05-08 11:51:00 -07:00
committed by GitHub
parent b6df5da195
commit 358bbe0c88

View File

@@ -165,7 +165,13 @@ class Database(
@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: