mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix(sqllab): null database with backend persistence (#19548)
This commit is contained in:
@@ -1393,10 +1393,21 @@ export function queryEditorSetFunctionNames(queryEditor, dbId) {
|
||||
functionNames: json.function_names,
|
||||
}),
|
||||
)
|
||||
.catch(() =>
|
||||
dispatch(
|
||||
addDangerToast(t('An error occurred while fetching function names.')),
|
||||
),
|
||||
);
|
||||
.catch(err => {
|
||||
if (err.status === 404) {
|
||||
// for databases that have been deleted, just reset the function names
|
||||
dispatch({
|
||||
type: QUERY_EDITOR_SET_FUNCTION_NAMES,
|
||||
queryEditor,
|
||||
functionNames: [],
|
||||
});
|
||||
} else {
|
||||
dispatch(
|
||||
addDangerToast(
|
||||
t('An error occurred while fetching function names.'),
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ class Query(Model, ExtraJSONMixin):
|
||||
"changedOn": self.changed_on,
|
||||
"changed_on": self.changed_on.isoformat(),
|
||||
"dbId": self.database_id,
|
||||
"db": self.database.database_name,
|
||||
"db": self.database.database_name if self.database else None,
|
||||
"endDttm": self.end_time,
|
||||
"errorMessage": self.error_message,
|
||||
"executedSql": self.executed_sql,
|
||||
|
||||
Reference in New Issue
Block a user