From 3b0b60c57f6c79abe9428273935d0b5ec36b728a Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Wed, 23 Mar 2022 15:38:33 -0700 Subject: [PATCH] feat: external management flags in CRUD (#19318) (cherry picked from commit 9766726b26e780c9e0d68eb8e8f9c27332c7a9d2) --- superset/charts/schemas.py | 4 ++++ superset/dashboards/schemas.py | 4 ++++ superset/databases/schemas.py | 4 ++++ superset/datasets/schemas.py | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/superset/charts/schemas.py b/superset/charts/schemas.py index 65261d7af98de..9ad56269d3915 100644 --- a/superset/charts/schemas.py +++ b/superset/charts/schemas.py @@ -210,6 +210,8 @@ class ChartPostSchema(Schema): certification_details = fields.String( description=certification_details_description, allow_none=True ) + is_managed_externally = fields.Boolean(allow_none=True, default=False) + external_url = fields.String(allow_none=True) class ChartPutSchema(Schema): @@ -251,6 +253,8 @@ class ChartPutSchema(Schema): certification_details = fields.String( description=certification_details_description, allow_none=True ) + is_managed_externally = fields.Boolean(allow_none=True, default=False) + external_url = fields.String(allow_none=True) class ChartGetDatasourceObjectDataResponseSchema(Schema): diff --git a/superset/dashboards/schemas.py b/superset/dashboards/schemas.py index 661c61e1c2483..71f9bc41261e6 100644 --- a/superset/dashboards/schemas.py +++ b/superset/dashboards/schemas.py @@ -249,6 +249,8 @@ class DashboardPostSchema(BaseDashboardSchema): certification_details = fields.String( description=certification_details_description, allow_none=True ) + is_managed_externally = fields.Boolean(allow_none=True, default=False) + external_url = fields.String(allow_none=True) class DashboardPutSchema(BaseDashboardSchema): @@ -278,6 +280,8 @@ class DashboardPutSchema(BaseDashboardSchema): certification_details = fields.String( description=certification_details_description, allow_none=True ) + is_managed_externally = fields.Boolean(allow_none=True, default=False) + external_url = fields.String(allow_none=True) class ChartFavStarResponseResult(Schema): diff --git a/superset/databases/schemas.py b/superset/databases/schemas.py index 4483b051f1be0..ee9b4a62d2694 100644 --- a/superset/databases/schemas.py +++ b/superset/databases/schemas.py @@ -386,6 +386,8 @@ class Meta: # pylint: disable=too-few-public-methods description=sqlalchemy_uri_description, validate=[Length(1, 1024), sqlalchemy_uri_validator], ) + is_managed_externally = fields.Boolean(allow_none=True, default=False) + external_url = fields.String(allow_none=True) class DatabasePutSchema(Schema, DatabaseParametersSchemaMixin): @@ -428,6 +430,8 @@ class Meta: # pylint: disable=too-few-public-methods description=sqlalchemy_uri_description, validate=[Length(0, 1024), sqlalchemy_uri_validator], ) + is_managed_externally = fields.Boolean(allow_none=True, default=False) + external_url = fields.String(allow_none=True) class DatabaseTestConnectionSchema(Schema, DatabaseParametersSchemaMixin): diff --git a/superset/datasets/schemas.py b/superset/datasets/schemas.py index 775798d274fa7..d85ce6c8cc753 100644 --- a/superset/datasets/schemas.py +++ b/superset/datasets/schemas.py @@ -80,6 +80,8 @@ class DatasetPostSchema(Schema): schema = fields.String(validate=Length(0, 250)) table_name = fields.String(required=True, allow_none=False, validate=Length(1, 250)) owners = fields.List(fields.Integer()) + is_managed_externally = fields.Boolean(allow_none=True, default=False) + external_url = fields.String(allow_none=True) class DatasetPutSchema(Schema): @@ -100,6 +102,8 @@ class DatasetPutSchema(Schema): columns = fields.List(fields.Nested(DatasetColumnsPutSchema)) metrics = fields.List(fields.Nested(DatasetMetricsPutSchema)) extra = fields.String(allow_none=True) + is_managed_externally = fields.Boolean(allow_none=True, default=False) + external_url = fields.String(allow_none=True) class DatasetRelatedChart(Schema):