mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
perf(export): export generates unnecessary files content (#26765)
This commit is contained in:
@@ -88,9 +88,22 @@ def test_export(session: Session) -> None:
|
||||
extra=json.dumps({"warning_markdown": "*WARNING*"}),
|
||||
)
|
||||
|
||||
export = list(
|
||||
ExportDatasetsCommand._export(sqla_table) # pylint: disable=protected-access
|
||||
export = [
|
||||
(file[0], file[1]())
|
||||
for file in list(
|
||||
ExportDatasetsCommand._export(
|
||||
sqla_table
|
||||
) # pylint: disable=protected-access
|
||||
)
|
||||
]
|
||||
|
||||
payload = sqla_table.export_to_dict(
|
||||
recursive=True,
|
||||
include_parent_ref=False,
|
||||
include_defaults=True,
|
||||
export_uuids=True,
|
||||
)
|
||||
|
||||
assert export == [
|
||||
(
|
||||
"datasets/my_database/my_table.yaml",
|
||||
@@ -114,7 +127,7 @@ extra:
|
||||
warning_markdown: '*WARNING*'
|
||||
normalize_columns: false
|
||||
always_filter_main_dttm: false
|
||||
uuid: null
|
||||
uuid: {payload['uuid']}
|
||||
metrics:
|
||||
- metric_name: cnt
|
||||
verbose_name: null
|
||||
@@ -129,12 +142,12 @@ metrics:
|
||||
columns:
|
||||
- column_name: profit
|
||||
verbose_name: null
|
||||
is_dttm: null
|
||||
is_active: null
|
||||
is_dttm: false
|
||||
is_active: true
|
||||
type: INTEGER
|
||||
advanced_data_type: null
|
||||
groupby: null
|
||||
filterable: null
|
||||
groupby: true
|
||||
filterable: true
|
||||
expression: revenue-expenses
|
||||
description: null
|
||||
python_date_format: null
|
||||
@@ -143,47 +156,47 @@ columns:
|
||||
- column_name: ds
|
||||
verbose_name: null
|
||||
is_dttm: 1
|
||||
is_active: null
|
||||
is_active: true
|
||||
type: TIMESTAMP
|
||||
advanced_data_type: null
|
||||
groupby: null
|
||||
filterable: null
|
||||
groupby: true
|
||||
filterable: true
|
||||
expression: null
|
||||
description: null
|
||||
python_date_format: null
|
||||
extra: null
|
||||
- column_name: user_id
|
||||
verbose_name: null
|
||||
is_dttm: null
|
||||
is_active: null
|
||||
is_dttm: false
|
||||
is_active: true
|
||||
type: INTEGER
|
||||
advanced_data_type: null
|
||||
groupby: null
|
||||
filterable: null
|
||||
groupby: true
|
||||
filterable: true
|
||||
expression: null
|
||||
description: null
|
||||
python_date_format: null
|
||||
extra: null
|
||||
- column_name: expenses
|
||||
verbose_name: null
|
||||
is_dttm: null
|
||||
is_active: null
|
||||
is_dttm: false
|
||||
is_active: true
|
||||
type: INTEGER
|
||||
advanced_data_type: null
|
||||
groupby: null
|
||||
filterable: null
|
||||
groupby: true
|
||||
filterable: true
|
||||
expression: null
|
||||
description: null
|
||||
python_date_format: null
|
||||
extra: null
|
||||
- column_name: revenue
|
||||
verbose_name: null
|
||||
is_dttm: null
|
||||
is_active: null
|
||||
is_dttm: false
|
||||
is_active: true
|
||||
type: INTEGER
|
||||
advanced_data_type: null
|
||||
groupby: null
|
||||
filterable: null
|
||||
groupby: true
|
||||
filterable: true
|
||||
expression: null
|
||||
description: null
|
||||
python_date_format: null
|
||||
|
||||
Reference in New Issue
Block a user