Skip to content

Commit

Permalink
chore: Refactor ExploreMixin to power both Datasets (SqlaTable) and Q…
Browse files Browse the repository at this point in the history
…uery models (apache#22853)
  • Loading branch information
hughhhh authored Apr 10, 2023
1 parent b44d203 commit d581d69
Show file tree
Hide file tree
Showing 10 changed files with 413 additions and 967 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export type ExploreQuery = QueryResponse & {
};

export interface ISimpleColumn {
name?: string | null;
column_name?: string | null;
type?: string | null;
is_dttm?: boolean | null;
}
Expand Down Expand Up @@ -216,7 +216,7 @@ export const SaveDatasetModal = ({
...formDataWithDefaults,
datasource: `${datasetToOverwrite.datasetid}__table`,
...(defaultVizType === 'table' && {
all_columns: datasource?.columns?.map(column => column.name),
all_columns: datasource?.columns?.map(column => column.column_name),
}),
}),
]);
Expand Down Expand Up @@ -301,7 +301,7 @@ export const SaveDatasetModal = ({
...formDataWithDefaults,
datasource: `${data.table_id}__table`,
...(defaultVizType === 'table' && {
all_columns: selectedColumns.map(column => column.name),
all_columns: selectedColumns.map(column => column.column_name),
}),
}),
)
Expand Down
6 changes: 3 additions & 3 deletions superset-frontend/src/SqlLab/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,17 +692,17 @@ export const testQuery: ISaveableDatasource = {
sql: 'SELECT *',
columns: [
{
name: 'Column 1',
column_name: 'Column 1',
type: DatasourceType.Query,
is_dttm: false,
},
{
name: 'Column 3',
column_name: 'Column 3',
type: DatasourceType.Query,
is_dttm: false,
},
{
name: 'Column 2',
column_name: 'Column 2',
type: DatasourceType.Query,
is_dttm: true,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AdhocMetricOption extends React.PureComponent {
}

onRemoveMetric(e) {
e.stopPropagation();
e?.stopPropagation();
this.props.onRemoveMetric(this.props.index);
}

Expand Down
Loading

0 comments on commit d581d69

Please sign in to comment.