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(dashboard import/export): include additional fields to export/import commands #24941

Merged
merged 3 commits into from
Aug 14, 2023
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
3 changes: 3 additions & 0 deletions superset/dashboards/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ class ImportV1DashboardSchema(Schema):
version = fields.String(required=True)
is_managed_externally = fields.Boolean(allow_none=True, dump_default=False)
external_url = fields.String(allow_none=True)
certified_by = fields.String(allow_none=True)
certification_details = fields.String(allow_none=True)
published = fields.Boolean(allow_none=True)


class EmbeddedDashboardConfigSchema(Schema):
Expand Down
3 changes: 3 additions & 0 deletions superset/models/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ class Dashboard(Model, AuditMixinNullable, ImportExportMixin):
"description",
"css",
"slug",
"certified_by",
"certification_details",
"published",
]
extra_import_fields = ["is_managed_externally", "external_url"]

Expand Down
6 changes: 6 additions & 0 deletions tests/integration_tests/dashboards/commands_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def test_export_dashboard_command(self, mock_g1, mock_g2):
"description": None,
"css": None,
"slug": "world_health",
"certified_by": None,
"certification_details": None,
"published": False,
"uuid": str(example_dashboard.uuid),
"position": {
"CHART-36bfc934": {
Expand Down Expand Up @@ -279,6 +282,9 @@ def test_export_dashboard_command_key_order(self, mock_g1, mock_g2):
"description",
"css",
"slug",
"certified_by",
"certification_details",
"published",
"uuid",
"position",
"metadata",
Expand Down
1 change: 1 addition & 0 deletions tests/integration_tests/import_export_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def create_dashboard(self, title, id=0, slcs=[]):
position_json='{"size_y": 2, "size_x": 2}',
slug=f"{title.lower()}_imported",
json_metadata=json.dumps(json_metadata),
published=False,
)

def create_table(self, name, schema=None, id=0, cols_names=[], metric_names=[]):
Expand Down