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(dashboard): export & import chart description and certification details #22471

Merged
merged 4 commits into from
Feb 6, 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/charts/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,9 @@ class GetFavStarIdsSchema(Schema):

class ImportV1ChartSchema(Schema):
slice_name = fields.String(required=True)
description = fields.String(allow_none=True)
certified_by = fields.String(allow_none=True)
certification_details = fields.String(allow_none=True)
viz_type = fields.String(required=True)
params = fields.Dict()
query_context = fields.String(allow_none=True, validate=utils.validate_json)
Expand Down
3 changes: 3 additions & 0 deletions superset/models/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ class Slice( # pylint: disable=too-many-public-methods

export_fields = [
"slice_name",
"description",
"certified_by",
"certification_details",
"datasource_type",
"datasource_name",
"viz_type",
Expand Down
9 changes: 9 additions & 0 deletions tests/integration_tests/charts/commands_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ def test_export_chart_command(self, mock_g):

assert metadata == {
"slice_name": "Energy Sankey",
"description": None,
"certified_by": None,
"certification_details": None,
"viz_type": "sankey",
"params": {
"collapsed_fieldsets": "",
Expand Down Expand Up @@ -110,6 +113,9 @@ def test_export_chart_with_query_context(self, mock_g):

assert metadata == {
"slice_name": "Heatmap",
"description": None,
"certified_by": None,
"certification_details": None,
"viz_type": "heatmap",
"params": {
"all_columns_x": "source",
Expand Down Expand Up @@ -168,6 +174,9 @@ def test_export_chart_command_key_order(self, mock_g):
)
assert list(metadata.keys()) == [
"slice_name",
"description",
"certified_by",
"certification_details",
"viz_type",
"params",
"cache_timeout",
Expand Down