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

fix(api): fixes perf on charts and introduces sorting by db on datasets #10392

Merged
merged 1 commit into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 5 additions & 3 deletions superset-frontend/src/views/datasetList/DatasetList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ type Dataset = {
changed_by_url: string;
changed_by: string;
changed_on_delta_humanized: string;
database_name: string;
database: {
id: string;
database_name: string;
};
explore_url: string;
id: number;
owners: Array<Owner>;
Expand Down Expand Up @@ -268,8 +271,7 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
},
{
Header: t('Source'),
accessor: 'database_name',
disableSortBy: true,
accessor: 'database.database_name',
size: 'lg',
},
{
Expand Down
4 changes: 0 additions & 4 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,6 @@ def description_markeddown(self) -> str:
def datasource_name(self) -> str:
return self.table_name

@property
def database_name(self) -> str:
return self.database.name

@classmethod
def get_datasource_by_name(
cls,
Expand Down
5 changes: 3 additions & 2 deletions superset/datasets/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class DatasetRestApi(BaseSupersetModelRestApi):
}
list_columns = [
"id",
"database_id",
"database_name",
"database.id",
"database.database_name",
"changed_by_name",
"changed_by_url",
"changed_by.first_name",
Expand All @@ -97,6 +97,7 @@ class DatasetRestApi(BaseSupersetModelRestApi):
"schema",
"changed_by.first_name",
"changed_on_delta_humanized",
"database.database_name",
]
show_columns = [
"database.database_name",
Expand Down
2 changes: 1 addition & 1 deletion superset/models/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def slice_link(self) -> Markup:

@property
def changed_by_url(self) -> str:
return f"/superset/profile/{self.created_by.username}" # type: ignore
return f"/superset/profile/{self.changed_by.username}" # type: ignore

@property
def icons(self) -> str:
Expand Down
3 changes: 1 addition & 2 deletions tests/datasets/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ def test_get_dataset_list(self):
"changed_by_url",
"changed_on_delta_humanized",
"changed_on_utc",
"database_id",
"database_name",
"database",
"default_endpoint",
"explore_url",
"id",
Expand Down