mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
bugfix: Improve support for special characters in schema and table names (#7297)
* Bugfix to SQL Lab to support tables and schemas with characters that require quoting * Remove debugging prints * Add uri encoding to secondary tables call * Quote schema names for presto * Quote selected_schema on Snowflake, MySQL and Hive * Remove redundant parens * Add python unit tests * Add js unit test * Fix flake8 linting error
This commit is contained in:
committed by
Maxime Beauchemin
parent
a3f091263a
commit
959c35d506
@@ -285,7 +285,8 @@ export function addTable(query, tableName, schemaName) {
|
||||
}),
|
||||
);
|
||||
|
||||
SupersetClient.get({ endpoint: `/superset/table/${query.dbId}/${tableName}/${schemaName}/` })
|
||||
SupersetClient.get({ endpoint: encodeURI(`/superset/table/${query.dbId}/` +
|
||||
`${encodeURIComponent(tableName)}/${encodeURIComponent(schemaName)}/`) })
|
||||
.then(({ json }) => {
|
||||
const dataPreviewQuery = {
|
||||
id: shortid.generate(),
|
||||
@@ -322,7 +323,8 @@ export function addTable(query, tableName, schemaName) {
|
||||
);
|
||||
|
||||
SupersetClient.get({
|
||||
endpoint: `/superset/extra_table_metadata/${query.dbId}/${tableName}/${schemaName}/`,
|
||||
endpoint: encodeURI(`/superset/extra_table_metadata/${query.dbId}/` +
|
||||
`${encodeURIComponent(tableName)}/${encodeURIComponent(schemaName)}/`),
|
||||
})
|
||||
.then(({ json }) =>
|
||||
dispatch(mergeTable({ ...table, ...json, isExtraMetadataLoading: false })),
|
||||
|
||||
Reference in New Issue
Block a user