You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/06/18 02:29:16 UTC
(superset) branch master updated: chore(sqllab): remove dead TableElement component and syncTable action (#41071)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 4acb777a405 chore(sqllab): remove dead TableElement component and syncTable action (#41071)
4acb777a405 is described below
commit 4acb777a405f8424ac7582377e2be9c2e18486ec
Author: Evan Rusackas <ev...@preset.io>
AuthorDate: Wed Jun 17 19:29:09 2026 -0700
chore(sqllab): remove dead TableElement component and syncTable action (#41071)
Co-authored-by: Superset Dev <de...@superset.apache.org>
Co-authored-by: Claude Fable 5 <no...@anthropic.com>
---
.../src/SqlLab/actions/sqlLab.test.ts | 33 ----------------
superset-frontend/src/SqlLab/actions/sqlLab.ts | 46 ----------------------
2 files changed, 79 deletions(-)
diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.test.ts b/superset-frontend/src/SqlLab/actions/sqlLab.test.ts
index ace26784469..ae53c83b77a 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.test.ts
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.test.ts
@@ -1420,39 +1420,6 @@ describe('async actions', () => {
});
});
- // eslint-disable-next-line no-restricted-globals -- TODO: Migrate from describe blocks
- describe('syncTable', () => {
- test('updates the table schema state in the backend', () => {
- expect.assertions(4);
-
- const tableName = 'table';
- const schemaName = 'schema';
- const store = mockStore(initialState);
- const expectedActionTypes = [
- actions.MERGE_TABLE, // syncTable
- ];
- const request = actions.syncTable(
- query as any,
- tableName as any,
- schemaName,
- );
- return request(store.dispatch, store.getState, undefined).then(() => {
- expect(store.getActions().map(a => a.type)).toEqual(
- expectedActionTypes,
- );
- expect(store.getActions()[0].prepend).toBeFalsy();
- expect(
- fetchMock.callHistory.calls(updateTableSchemaEndpoint),
- ).toHaveLength(1);
-
- // tab state is not updated, since no query was run
- expect(
- fetchMock.callHistory.calls(updateTabStateEndpoint),
- ).toHaveLength(0);
- });
- });
- });
-
// eslint-disable-next-line no-restricted-globals -- TODO: Migrate from describe blocks
describe('runTablePreviewQuery', () => {
const results = {
diff --git a/superset-frontend/src/SqlLab/actions/sqlLab.ts b/superset-frontend/src/SqlLab/actions/sqlLab.ts
index 7058471a55b..072bfd05260 100644
--- a/superset-frontend/src/SqlLab/actions/sqlLab.ts
+++ b/superset-frontend/src/SqlLab/actions/sqlLab.ts
@@ -1346,52 +1346,6 @@ export function runTablePreviewQuery(
};
}
-export interface TableMetaData {
- columns?: unknown[];
- selectStar?: string;
- primaryKey?: unknown;
- foreignKeys?: unknown[];
- indexes?: unknown[];
-}
-
-export function syncTable(
- table: Table,
- tableMetadata: TableMetaData,
- finalQueryEditorId?: string,
-): SqlLabThunkAction<Promise<unknown>> {
- return function (dispatch: AppDispatch) {
- const finalTable = { ...table, queryEditorId: finalQueryEditorId };
- const sync = isFeatureEnabled(FeatureFlag.SqllabBackendPersistence)
- ? SupersetClient.post({
- endpoint: encodeURI('/tableschemaview/'),
- postPayload: { table: { ...tableMetadata, ...finalTable } },
- })
- : Promise.resolve({ json: { id: table.id } });
-
- return sync
- .then(({ json: resultJson }) => {
- const newTable = { ...table, id: `${resultJson.id}` };
- dispatch(
- mergeTable({
- ...newTable,
- expanded: true,
- initialized: true,
- }),
- );
- })
- .catch(() =>
- dispatch(
- addDangerToast(
- t(
- 'An error occurred while fetching table metadata. ' +
- 'Please contact your administrator.',
- ),
- ),
- ),
- );
- };
-}
-
export function changeDataPreviewId(
oldQueryId: string,
newQuery: Query,