From 3c61ea8d6b43688105f82a3ab7afc28d01a94229 Mon Sep 17 00:00:00 2001 From: Vitor Avila Date: Wed, 9 Aug 2023 00:19:12 -0300 Subject: [PATCH 1/3] chore(dashboard import/export): include additional fields --- superset/dashboards/schemas.py | 3 +++ superset/models/dashboard.py | 3 +++ tests/integration_tests/dashboards/commands_tests.py | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/superset/dashboards/schemas.py b/superset/dashboards/schemas.py index b5a12737ad217..9054af6da8ce1 100644 --- a/superset/dashboards/schemas.py +++ b/superset/dashboards/schemas.py @@ -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): diff --git a/superset/models/dashboard.py b/superset/models/dashboard.py index 20f2f7e685f07..1d02c65b590b9 100644 --- a/superset/models/dashboard.py +++ b/superset/models/dashboard.py @@ -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"] diff --git a/tests/integration_tests/dashboards/commands_tests.py b/tests/integration_tests/dashboards/commands_tests.py index 7106a978c4170..75bdd17bcf158 100644 --- a/tests/integration_tests/dashboards/commands_tests.py +++ b/tests/integration_tests/dashboards/commands_tests.py @@ -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": { @@ -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", From 997ce0ba242d5a7b451f18be3d940a42044ffd6d Mon Sep 17 00:00:00 2001 From: Vitor Avila Date: Sun, 13 Aug 2023 22:44:41 -0300 Subject: [PATCH 2/3] Retrigger test From a53abe2854dd02aff5691d080a676e8930c6bd24 Mon Sep 17 00:00:00 2001 From: Vitor Avila Date: Mon, 14 Aug 2023 16:39:39 -0300 Subject: [PATCH 3/3] Fixing tests --- tests/integration_tests/import_export_tests.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration_tests/import_export_tests.py b/tests/integration_tests/import_export_tests.py index d44745377f562..4c7f2477c9ada 100644 --- a/tests/integration_tests/import_export_tests.py +++ b/tests/integration_tests/import_export_tests.py @@ -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=[]):