mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
chore(sqllab): Remove table metadata from state (#24371)
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import pick from 'lodash/pick';
|
||||
import {
|
||||
BYTES_PER_CHAR,
|
||||
KB_STORAGE,
|
||||
@@ -50,6 +51,21 @@ function shouldEmptyQueryResults(query) {
|
||||
);
|
||||
}
|
||||
|
||||
export function emptyTablePersistData(tables) {
|
||||
return tables
|
||||
.map(table =>
|
||||
pick(table, [
|
||||
'id',
|
||||
'name',
|
||||
'dbId',
|
||||
'schema',
|
||||
'dataPreviewQueryId',
|
||||
'queryEditorId',
|
||||
]),
|
||||
)
|
||||
.filter(({ queryEditorId }) => Boolean(queryEditorId));
|
||||
}
|
||||
|
||||
export function emptyQueryResults(queries) {
|
||||
return Object.keys(queries).reduce((accu, key) => {
|
||||
const { results } = queries[key];
|
||||
|
||||
Reference in New Issue
Block a user