Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Refactor ExploreMixin to power both Datasets (SqlaTable) and Query models #22853

Merged
merged 35 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e386bc4
re patch sqlatable into exploremixin
hughhhh Jan 20, 2023
bf36bfa
Merge branch 'master' of https://github.com/apache/superset into fix-…
hughhhh Jan 24, 2023
4528add
mk1: working explore with sqlatable model with exploremixin
hughhhh Jan 24, 2023
516dde4
working sqlatable + query with uncommented code that needs to be cleaned
hughhhh Jan 24, 2023
47c2f83
fix linting
hughhhh Jan 25, 2023
8391997
Merge branch 'master' of https://github.com/apache/superset into fix-…
hughhhh Jan 31, 2023
247f223
fix logos for columns
hughhhh Feb 7, 2023
d4e4869
add filterable true to allow columns to have metrics
hughhhh Feb 15, 2023
ce25c86
only stop propagation if e is defined
hughhhh Feb 20, 2023
ba75281
fix save
hughhhh Feb 22, 2023
b629760
remove log
hughhhh Feb 22, 2023
99d9070
fix linting
hughhhh Feb 22, 2023
d4b6d04
change column name references
hughhhh Feb 22, 2023
e1ab0ac
fix lint
hughhhh Feb 22, 2023
caa0b89
Merge branch 'master' of https://github.com/apache/superset into fix-…
hughhhh Feb 22, 2023
bdd0727
pre-commit
hughhhh Feb 22, 2023
f2b512f
lint
hughhhh Feb 22, 2023
8937044
address concerns
hughhhh Feb 28, 2023
1d443b7
fix saving columns
hughhhh Mar 20, 2023
303a92e
add fix for name vs column_name
hughhhh Mar 20, 2023
e7a9257
Merge branch 'master' of https://github.com/apache/superset into fix-…
hughhhh Mar 20, 2023
7376596
Merge branch 'master' of https://github.com/apache/superset into fix-…
hughhhh Apr 3, 2023
0c00253
add QueryStringExtended
hughhhh Apr 3, 2023
d178aca
bring in master
hughhhh Apr 3, 2023
9d5dd92
ok
hughhhh Apr 4, 2023
29dfe09
ok
hughhhh Apr 4, 2023
dccf089
lit
hughhhh Apr 4, 2023
924514a
lint
hughhhh Apr 4, 2023
1dd895b
maybe
hughhhh Apr 6, 2023
15a6975
Merge branch 'master' of https://github.com/apache/superset into fix-…
hughhhh Apr 6, 2023
245d0ad
ask for check
hughhhh Apr 7, 2023
f32b549
linting
hughhhh Apr 7, 2023
df47fb0
linting
hughhhh Apr 7, 2023
266e224
lint 1 more
hughhhh Apr 7, 2023
dfe7191
fe build fix
hughhhh Apr 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why we're changing this? column.column_name is redundant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we are condensing Query to use the TableColumn model object we need make the names match

column_name = Column(String(255), nullable=False)

Before we were managing our on dict inside extra, and I made is name originally

eschutho marked this conversation as resolved.
Show resolved Hide resolved
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