mirror of https://github.com/apache/superset.git
fix(api): fixes perf on charts and introduces sorting by database on datasets (#10392)
This commit is contained in:
parent
e0264060c3
commit
2fd37b18e3
|
@ -54,7 +54,10 @@ type Dataset = {
|
||||||
changed_by_url: string;
|
changed_by_url: string;
|
||||||
changed_by: string;
|
changed_by: string;
|
||||||
changed_on_delta_humanized: string;
|
changed_on_delta_humanized: string;
|
||||||
database_name: string;
|
database: {
|
||||||
|
id: string;
|
||||||
|
database_name: string;
|
||||||
|
};
|
||||||
explore_url: string;
|
explore_url: string;
|
||||||
id: number;
|
id: number;
|
||||||
owners: Array<Owner>;
|
owners: Array<Owner>;
|
||||||
|
@ -275,8 +278,7 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: t('Source'),
|
Header: t('Source'),
|
||||||
accessor: 'database_name',
|
accessor: 'database.database_name',
|
||||||
disableSortBy: true,
|
|
||||||
size: 'lg',
|
size: 'lg',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -493,10 +493,6 @@ class SqlaTable( # pylint: disable=too-many-public-methods,too-many-instance-at
|
||||||
def datasource_name(self) -> str:
|
def datasource_name(self) -> str:
|
||||||
return self.table_name
|
return self.table_name
|
||||||
|
|
||||||
@property
|
|
||||||
def database_name(self) -> str:
|
|
||||||
return self.database.name
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_datasource_by_name(
|
def get_datasource_by_name(
|
||||||
cls,
|
cls,
|
||||||
|
|
|
@ -72,8 +72,8 @@ class DatasetRestApi(BaseSupersetModelRestApi):
|
||||||
}
|
}
|
||||||
list_columns = [
|
list_columns = [
|
||||||
"id",
|
"id",
|
||||||
"database_id",
|
"database.id",
|
||||||
"database_name",
|
"database.database_name",
|
||||||
"changed_by_name",
|
"changed_by_name",
|
||||||
"changed_by_url",
|
"changed_by_url",
|
||||||
"changed_by.first_name",
|
"changed_by.first_name",
|
||||||
|
@ -97,6 +97,7 @@ class DatasetRestApi(BaseSupersetModelRestApi):
|
||||||
"schema",
|
"schema",
|
||||||
"changed_by.first_name",
|
"changed_by.first_name",
|
||||||
"changed_on_delta_humanized",
|
"changed_on_delta_humanized",
|
||||||
|
"database.database_name",
|
||||||
]
|
]
|
||||||
show_columns = [
|
show_columns = [
|
||||||
"database.database_name",
|
"database.database_name",
|
||||||
|
|
|
@ -269,7 +269,7 @@ class Slice(
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def changed_by_url(self) -> str:
|
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
|
@property
|
||||||
def icons(self) -> str:
|
def icons(self) -> str:
|
||||||
|
|
|
@ -92,8 +92,7 @@ class TestDatasetApi(SupersetTestCase):
|
||||||
"changed_by_url",
|
"changed_by_url",
|
||||||
"changed_on_delta_humanized",
|
"changed_on_delta_humanized",
|
||||||
"changed_on_utc",
|
"changed_on_utc",
|
||||||
"database_id",
|
"database",
|
||||||
"database_name",
|
|
||||||
"default_endpoint",
|
"default_endpoint",
|
||||||
"explore_url",
|
"explore_url",
|
||||||
"id",
|
"id",
|
||||||
|
|
Loading…
Reference in New Issue