chore: remove RemovedInMarshmallow4 warnings (#23704)
This commit is contained in:
parent
295975d16b
commit
b31efbae7c
|
|
@ -39,8 +39,10 @@ class AdvancedDataTypeSchema(Schema):
|
|||
"""
|
||||
|
||||
error_message = fields.String()
|
||||
values = fields.List(fields.String(description="parsed value (can be any value)"))
|
||||
values = fields.List(
|
||||
fields.String(metadata={"description": "parsed value (can be any value)"})
|
||||
)
|
||||
display_value = fields.String(
|
||||
description="The string representation of the parsed values"
|
||||
metadata={"description": "The string representation of the parsed values"}
|
||||
)
|
||||
valid_filter_operators = fields.List(fields.String())
|
||||
|
|
|
|||
|
|
@ -57,22 +57,24 @@ def validate_json(value: Union[bytes, bytearray, str]) -> None:
|
|||
|
||||
class AnnotationPostSchema(Schema):
|
||||
short_descr = fields.String(
|
||||
description=annotation_short_descr,
|
||||
metadata={"description": annotation_short_descr},
|
||||
required=True,
|
||||
allow_none=False,
|
||||
validate=[Length(1, 500)],
|
||||
)
|
||||
long_descr = fields.String(description=annotation_long_descr, allow_none=True)
|
||||
long_descr = fields.String(
|
||||
metadata={"description": annotation_long_descr}, allow_none=True
|
||||
)
|
||||
start_dttm = fields.DateTime(
|
||||
description=annotation_start_dttm,
|
||||
metadata={"description": annotation_start_dttm},
|
||||
required=True,
|
||||
allow_none=False,
|
||||
)
|
||||
end_dttm = fields.DateTime(
|
||||
description=annotation_end_dttm, required=True, allow_none=False
|
||||
metadata={"description": annotation_end_dttm}, required=True, allow_none=False
|
||||
)
|
||||
json_metadata = fields.String(
|
||||
description=annotation_json_metadata,
|
||||
metadata={"description": annotation_json_metadata},
|
||||
validate=validate_json,
|
||||
allow_none=True,
|
||||
)
|
||||
|
|
@ -80,15 +82,21 @@ class AnnotationPostSchema(Schema):
|
|||
|
||||
class AnnotationPutSchema(Schema):
|
||||
short_descr = fields.String(
|
||||
description=annotation_short_descr, required=False, validate=[Length(1, 500)]
|
||||
metadata={"description": annotation_short_descr},
|
||||
required=False,
|
||||
validate=[Length(1, 500)],
|
||||
)
|
||||
long_descr = fields.String(
|
||||
description=annotation_long_descr, required=False, allow_none=True
|
||||
metadata={"description": annotation_long_descr}, required=False, allow_none=True
|
||||
)
|
||||
start_dttm = fields.DateTime(
|
||||
metadata={"description": annotation_start_dttm}, required=False
|
||||
)
|
||||
end_dttm = fields.DateTime(
|
||||
metadata={"description": annotation_end_dttm}, required=False
|
||||
)
|
||||
start_dttm = fields.DateTime(description=annotation_start_dttm, required=False)
|
||||
end_dttm = fields.DateTime(description=annotation_end_dttm, required=False)
|
||||
json_metadata = fields.String(
|
||||
description=annotation_json_metadata,
|
||||
metadata={"description": annotation_json_metadata},
|
||||
validate=validate_json,
|
||||
required=False,
|
||||
allow_none=True,
|
||||
|
|
|
|||
|
|
@ -40,13 +40,21 @@ annotation_layer_descr = "Give a description for this annotation layer"
|
|||
|
||||
class AnnotationLayerPostSchema(Schema):
|
||||
name = fields.String(
|
||||
description=annotation_layer_name, required=True, validate=[Length(1, 250)]
|
||||
metadata={"description": annotation_layer_name},
|
||||
required=True,
|
||||
validate=[Length(1, 250)],
|
||||
)
|
||||
descr = fields.String(
|
||||
metadata={"description": annotation_layer_descr}, allow_none=True
|
||||
)
|
||||
descr = fields.String(description=annotation_layer_descr, allow_none=True)
|
||||
|
||||
|
||||
class AnnotationLayerPutSchema(Schema):
|
||||
name = fields.String(
|
||||
description=annotation_layer_name, required=False, validate=[Length(1, 250)]
|
||||
metadata={"description": annotation_layer_name},
|
||||
required=False,
|
||||
validate=[Length(1, 250)],
|
||||
)
|
||||
descr = fields.String(
|
||||
metadata={"description": annotation_layer_descr}, required=False
|
||||
)
|
||||
descr = fields.String(description=annotation_layer_descr, required=False)
|
||||
|
|
|
|||
|
|
@ -27,16 +27,16 @@ from superset.utils.core import DatasourceType
|
|||
|
||||
class Datasource(Schema):
|
||||
database_name = fields.String(
|
||||
description="Datasource name",
|
||||
metadata={"description": "Datasource name"},
|
||||
)
|
||||
datasource_name = fields.String(
|
||||
description=datasource_name_description,
|
||||
metadata={"description": datasource_name_description},
|
||||
)
|
||||
schema = fields.String(
|
||||
description="Datasource schema",
|
||||
metadata={"description": "Datasource schema"},
|
||||
)
|
||||
datasource_type = fields.String(
|
||||
description=datasource_type_description,
|
||||
metadata={"description": datasource_type_description},
|
||||
validate=validate.OneOf(choices=[ds.value for ds in DatasourceType]),
|
||||
required=True,
|
||||
)
|
||||
|
|
@ -45,9 +45,9 @@ class Datasource(Schema):
|
|||
class CacheInvalidationRequestSchema(Schema):
|
||||
datasource_uids = fields.List(
|
||||
fields.String(),
|
||||
description=datasource_uid_description,
|
||||
metadata={"description": datasource_uid_description},
|
||||
)
|
||||
datasources = fields.List(
|
||||
fields.Nested(Datasource),
|
||||
description="A list of the data source and database names",
|
||||
metadata={"description": "A list of the data source and database names"},
|
||||
)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -21,30 +21,34 @@ class DashboardPermalinkPostSchema(Schema):
|
|||
dataMask = fields.Dict(
|
||||
required=False,
|
||||
allow_none=True,
|
||||
description="Data mask used for native filter state",
|
||||
metadata={"description": "Data mask used for native filter state"},
|
||||
)
|
||||
activeTabs = fields.List(
|
||||
fields.String(),
|
||||
required=False,
|
||||
allow_none=True,
|
||||
description="Current active dashboard tabs",
|
||||
metadata={"description": "Current active dashboard tabs"},
|
||||
)
|
||||
urlParams = fields.List(
|
||||
fields.Tuple(
|
||||
(
|
||||
fields.String(required=True, allow_none=True, description="Key"),
|
||||
fields.String(required=True, allow_none=True, description="Value"),
|
||||
fields.String(
|
||||
required=True, allow_none=True, metadata={"description": "Key"}
|
||||
),
|
||||
fields.String(
|
||||
required=True, allow_none=True, metadata={"description": "Value"}
|
||||
),
|
||||
),
|
||||
required=False,
|
||||
allow_none=True,
|
||||
description="URL Parameter key-value pair",
|
||||
metadata={"description": "URL Parameter key-value pair"},
|
||||
),
|
||||
required=False,
|
||||
allow_none=True,
|
||||
description="URL Parameters",
|
||||
metadata={"description": "URL Parameters"},
|
||||
)
|
||||
anchor = fields.String(
|
||||
required=False,
|
||||
allow_none=True,
|
||||
description="Optional anchor link added to url hash",
|
||||
metadata={"description": "Optional anchor link added to url hash"},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class DashboardJSONMetadataSchema(Schema):
|
|||
label_colors = fields.Dict()
|
||||
shared_label_colors = fields.Dict()
|
||||
color_scheme_domain = fields.List(fields.Str())
|
||||
cross_filters_enabled = fields.Boolean(default=True)
|
||||
cross_filters_enabled = fields.Boolean(dump_default=True)
|
||||
# used for v0 import/export
|
||||
import_time = fields.Integer()
|
||||
remote_id = fields.Integer()
|
||||
|
|
@ -176,24 +176,28 @@ class DashboardGetResponseSchema(Schema):
|
|||
id = fields.Int()
|
||||
slug = fields.String()
|
||||
url = fields.String()
|
||||
dashboard_title = fields.String(description=dashboard_title_description)
|
||||
dashboard_title = fields.String(
|
||||
metadata={"description": dashboard_title_description}
|
||||
)
|
||||
thumbnail_url = fields.String()
|
||||
published = fields.Boolean()
|
||||
css = fields.String(description=css_description)
|
||||
json_metadata = fields.String(description=json_metadata_description)
|
||||
position_json = fields.String(description=position_json_description)
|
||||
certified_by = fields.String(description=certified_by_description)
|
||||
certification_details = fields.String(description=certification_details_description)
|
||||
css = fields.String(metadata={"description": css_description})
|
||||
json_metadata = fields.String(metadata={"description": json_metadata_description})
|
||||
position_json = fields.String(metadata={"description": position_json_description})
|
||||
certified_by = fields.String(metadata={"description": certified_by_description})
|
||||
certification_details = fields.String(
|
||||
metadata={"description": certification_details_description}
|
||||
)
|
||||
changed_by_name = fields.String()
|
||||
changed_by_url = fields.String()
|
||||
changed_by = fields.Nested(UserSchema)
|
||||
changed_on = fields.DateTime()
|
||||
charts = fields.List(fields.String(description=charts_description))
|
||||
charts = fields.List(fields.String(metadata={"description": charts_description}))
|
||||
owners = fields.List(fields.Nested(UserSchema))
|
||||
roles = fields.List(fields.Nested(RolesSchema))
|
||||
tags = fields.Nested(TagSchema, many=True)
|
||||
changed_on_humanized = fields.String(data_key="changed_on_delta_humanized")
|
||||
is_managed_externally = fields.Boolean(allow_none=True, default=False)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, dump_default=False)
|
||||
|
||||
|
||||
class DatabaseSchema(Schema):
|
||||
|
|
@ -255,89 +259,107 @@ class BaseDashboardSchema(Schema):
|
|||
|
||||
class DashboardPostSchema(BaseDashboardSchema):
|
||||
dashboard_title = fields.String(
|
||||
description=dashboard_title_description,
|
||||
metadata={"description": dashboard_title_description},
|
||||
allow_none=True,
|
||||
validate=Length(0, 500),
|
||||
)
|
||||
slug = fields.String(
|
||||
description=slug_description, allow_none=True, validate=[Length(1, 255)]
|
||||
metadata={"description": slug_description},
|
||||
allow_none=True,
|
||||
validate=[Length(1, 255)],
|
||||
)
|
||||
owners = fields.List(fields.Integer(description=owners_description))
|
||||
roles = fields.List(fields.Integer(description=roles_description))
|
||||
owners = fields.List(fields.Integer(metadata={"description": owners_description}))
|
||||
roles = fields.List(fields.Integer(metadata={"description": roles_description}))
|
||||
position_json = fields.String(
|
||||
description=position_json_description, validate=validate_json
|
||||
metadata={"description": position_json_description}, validate=validate_json
|
||||
)
|
||||
css = fields.String(description=css_description)
|
||||
css = fields.String(metadata={"description": css_description})
|
||||
json_metadata = fields.String(
|
||||
description=json_metadata_description,
|
||||
metadata={"description": json_metadata_description},
|
||||
validate=validate_json_metadata,
|
||||
)
|
||||
published = fields.Boolean(description=published_description)
|
||||
certified_by = fields.String(description=certified_by_description, allow_none=True)
|
||||
certification_details = fields.String(
|
||||
description=certification_details_description, allow_none=True
|
||||
published = fields.Boolean(metadata={"description": published_description})
|
||||
certified_by = fields.String(
|
||||
metadata={"description": certified_by_description}, allow_none=True
|
||||
)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, default=False)
|
||||
certification_details = fields.String(
|
||||
metadata={"description": certification_details_description}, allow_none=True
|
||||
)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, dump_default=False)
|
||||
external_url = fields.String(allow_none=True)
|
||||
|
||||
|
||||
class DashboardCopySchema(Schema):
|
||||
dashboard_title = fields.String(
|
||||
description=dashboard_title_description,
|
||||
metadata={"description": dashboard_title_description},
|
||||
allow_none=True,
|
||||
validate=Length(0, 500),
|
||||
)
|
||||
css = fields.String(description=css_description)
|
||||
css = fields.String(metadata={"description": css_description})
|
||||
json_metadata = fields.String(
|
||||
description=json_metadata_description,
|
||||
metadata={"description": json_metadata_description},
|
||||
validate=validate_json_metadata,
|
||||
required=True,
|
||||
)
|
||||
duplicate_slices = fields.Boolean(
|
||||
description="Whether or not to also copy all charts on the dashboard"
|
||||
metadata={
|
||||
"description": "Whether or not to also copy all charts on the dashboard"
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class DashboardPutSchema(BaseDashboardSchema):
|
||||
dashboard_title = fields.String(
|
||||
description=dashboard_title_description,
|
||||
metadata={"description": dashboard_title_description},
|
||||
allow_none=True,
|
||||
validate=Length(0, 500),
|
||||
)
|
||||
slug = fields.String(
|
||||
description=slug_description, allow_none=True, validate=Length(0, 255)
|
||||
metadata={"description": slug_description},
|
||||
allow_none=True,
|
||||
validate=Length(0, 255),
|
||||
)
|
||||
owners = fields.List(
|
||||
fields.Integer(description=owners_description, allow_none=True)
|
||||
fields.Integer(metadata={"description": owners_description}, allow_none=True)
|
||||
)
|
||||
roles = fields.List(
|
||||
fields.Integer(metadata={"description": roles_description}, allow_none=True)
|
||||
)
|
||||
roles = fields.List(fields.Integer(description=roles_description, allow_none=True))
|
||||
position_json = fields.String(
|
||||
description=position_json_description, allow_none=True, validate=validate_json
|
||||
metadata={"description": position_json_description},
|
||||
allow_none=True,
|
||||
validate=validate_json,
|
||||
)
|
||||
css = fields.String(description=css_description, allow_none=True)
|
||||
css = fields.String(metadata={"description": css_description}, allow_none=True)
|
||||
json_metadata = fields.String(
|
||||
description=json_metadata_description,
|
||||
metadata={"description": json_metadata_description},
|
||||
allow_none=True,
|
||||
validate=validate_json_metadata,
|
||||
)
|
||||
published = fields.Boolean(description=published_description, allow_none=True)
|
||||
certified_by = fields.String(description=certified_by_description, allow_none=True)
|
||||
certification_details = fields.String(
|
||||
description=certification_details_description, allow_none=True
|
||||
published = fields.Boolean(
|
||||
metadata={"description": published_description}, allow_none=True
|
||||
)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, default=False)
|
||||
certified_by = fields.String(
|
||||
metadata={"description": certified_by_description}, allow_none=True
|
||||
)
|
||||
certification_details = fields.String(
|
||||
metadata={"description": certification_details_description}, allow_none=True
|
||||
)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, dump_default=False)
|
||||
external_url = fields.String(allow_none=True)
|
||||
|
||||
|
||||
class ChartFavStarResponseResult(Schema):
|
||||
id = fields.Integer(description="The Chart id")
|
||||
value = fields.Boolean(description="The FaveStar value")
|
||||
id = fields.Integer(metadata={"description": "The Chart id"})
|
||||
value = fields.Boolean(metadata={"description": "The FaveStar value"})
|
||||
|
||||
|
||||
class GetFavStarIdsSchema(Schema):
|
||||
result = fields.List(
|
||||
fields.Nested(ChartFavStarResponseResult),
|
||||
description="A list of results for each corresponding chart in the request",
|
||||
metadata={
|
||||
"description": "A list of results for each corresponding chart in the request"
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -350,7 +372,7 @@ class ImportV1DashboardSchema(Schema):
|
|||
position = fields.Dict()
|
||||
metadata = fields.Dict()
|
||||
version = fields.String(required=True)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, default=False)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, dump_default=False)
|
||||
external_url = fields.String(allow_none=True)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -243,18 +243,22 @@ class DatabaseParametersSchemaMixin: # pylint: disable=too-few-public-methods
|
|||
When using this mixin make sure that `sqlalchemy_uri` is not required.
|
||||
"""
|
||||
|
||||
engine = fields.String(allow_none=True, description="SQLAlchemy engine to use")
|
||||
driver = fields.String(allow_none=True, description="SQLAlchemy driver to use")
|
||||
engine = fields.String(
|
||||
allow_none=True, metadata={"description": "SQLAlchemy engine to use"}
|
||||
)
|
||||
driver = fields.String(
|
||||
allow_none=True, metadata={"description": "SQLAlchemy driver to use"}
|
||||
)
|
||||
parameters = fields.Dict(
|
||||
keys=fields.String(),
|
||||
values=fields.Raw(),
|
||||
description="DB-specific parameters for configuration",
|
||||
metadata={"description": "DB-specific parameters for configuration"},
|
||||
)
|
||||
configuration_method = EnumField(
|
||||
ConfigurationMethod,
|
||||
by_value=True,
|
||||
description=configuration_method_description,
|
||||
missing=ConfigurationMethod.SQLALCHEMY_FORM,
|
||||
metadata={"description": configuration_method_description},
|
||||
load_default=ConfigurationMethod.SQLALCHEMY_FORM,
|
||||
)
|
||||
|
||||
@pre_load
|
||||
|
|
@ -341,33 +345,45 @@ class DatabaseValidateParametersSchema(Schema):
|
|||
|
||||
rename_encrypted_extra = pre_load(rename_encrypted_extra)
|
||||
|
||||
id = fields.Integer(allow_none=True, description="Database ID (for updates)")
|
||||
engine = fields.String(required=True, description="SQLAlchemy engine to use")
|
||||
driver = fields.String(allow_none=True, description="SQLAlchemy driver to use")
|
||||
id = fields.Integer(
|
||||
allow_none=True, metadata={"description": "Database ID (for updates)"}
|
||||
)
|
||||
engine = fields.String(
|
||||
required=True, metadata={"description": "SQLAlchemy engine to use"}
|
||||
)
|
||||
driver = fields.String(
|
||||
allow_none=True, metadata={"description": "SQLAlchemy driver to use"}
|
||||
)
|
||||
parameters = fields.Dict(
|
||||
keys=fields.String(),
|
||||
values=fields.Raw(allow_none=True),
|
||||
description="DB-specific parameters for configuration",
|
||||
metadata={"description": "DB-specific parameters for configuration"},
|
||||
)
|
||||
catalog = fields.Dict(
|
||||
keys=fields.String(),
|
||||
values=fields.Raw(allow_none=True),
|
||||
description="Gsheets specific column for managing label to sheet urls",
|
||||
metadata={
|
||||
"description": "Gsheets specific column for managing label to sheet urls"
|
||||
},
|
||||
)
|
||||
database_name = fields.String(
|
||||
description=database_name_description,
|
||||
metadata={"description": database_name_description},
|
||||
allow_none=True,
|
||||
validate=Length(1, 250),
|
||||
)
|
||||
impersonate_user = fields.Boolean(description=impersonate_user_description)
|
||||
extra = fields.String(description=extra_description, validate=extra_validator)
|
||||
impersonate_user = fields.Boolean(
|
||||
metadata={"description": impersonate_user_description}
|
||||
)
|
||||
extra = fields.String(
|
||||
metadata={"description": extra_description}, validate=extra_validator
|
||||
)
|
||||
masked_encrypted_extra = fields.String(
|
||||
description=encrypted_extra_description,
|
||||
metadata={"description": encrypted_extra_description},
|
||||
validate=encrypted_extra_validator,
|
||||
allow_none=True,
|
||||
)
|
||||
server_cert = fields.String(
|
||||
description=server_cert_description,
|
||||
metadata={"description": server_cert_description},
|
||||
allow_none=True,
|
||||
validate=server_cert_validator,
|
||||
)
|
||||
|
|
@ -375,12 +391,14 @@ class DatabaseValidateParametersSchema(Schema):
|
|||
ConfigurationMethod,
|
||||
by_value=True,
|
||||
required=True,
|
||||
description=configuration_method_description,
|
||||
metadata={"description": configuration_method_description},
|
||||
)
|
||||
|
||||
|
||||
class DatabaseSSHTunnel(Schema):
|
||||
id = fields.Integer(allow_none=True, description="SSH Tunnel ID (for updates)")
|
||||
id = fields.Integer(
|
||||
allow_none=True, metadata={"description": "SSH Tunnel ID (for updates)"}
|
||||
)
|
||||
server_address = fields.String()
|
||||
server_port = fields.Integer()
|
||||
username = fields.String()
|
||||
|
|
@ -400,41 +418,51 @@ class DatabasePostSchema(Schema, DatabaseParametersSchemaMixin):
|
|||
rename_encrypted_extra = pre_load(rename_encrypted_extra)
|
||||
|
||||
database_name = fields.String(
|
||||
description=database_name_description,
|
||||
metadata={"description": database_name_description},
|
||||
required=True,
|
||||
validate=Length(1, 250),
|
||||
)
|
||||
cache_timeout = fields.Integer(
|
||||
description=cache_timeout_description, allow_none=True
|
||||
metadata={"description": cache_timeout_description}, allow_none=True
|
||||
)
|
||||
expose_in_sqllab = fields.Boolean(description=expose_in_sqllab_description)
|
||||
allow_run_async = fields.Boolean(description=allow_run_async_description)
|
||||
allow_file_upload = fields.Boolean(description=allow_file_upload_description)
|
||||
allow_ctas = fields.Boolean(description=allow_ctas_description)
|
||||
allow_cvas = fields.Boolean(description=allow_cvas_description)
|
||||
allow_dml = fields.Boolean(description=allow_dml_description)
|
||||
expose_in_sqllab = fields.Boolean(
|
||||
metadata={"description": expose_in_sqllab_description}
|
||||
)
|
||||
allow_run_async = fields.Boolean(
|
||||
metadata={"description": allow_run_async_description}
|
||||
)
|
||||
allow_file_upload = fields.Boolean(
|
||||
metadata={"description": allow_file_upload_description}
|
||||
)
|
||||
allow_ctas = fields.Boolean(metadata={"description": allow_ctas_description})
|
||||
allow_cvas = fields.Boolean(metadata={"description": allow_cvas_description})
|
||||
allow_dml = fields.Boolean(metadata={"description": allow_dml_description})
|
||||
force_ctas_schema = fields.String(
|
||||
description=force_ctas_schema_description,
|
||||
metadata={"description": force_ctas_schema_description},
|
||||
allow_none=True,
|
||||
validate=Length(0, 250),
|
||||
)
|
||||
impersonate_user = fields.Boolean(description=impersonate_user_description)
|
||||
impersonate_user = fields.Boolean(
|
||||
metadata={"description": impersonate_user_description}
|
||||
)
|
||||
masked_encrypted_extra = fields.String(
|
||||
description=encrypted_extra_description,
|
||||
metadata={"description": encrypted_extra_description},
|
||||
validate=encrypted_extra_validator,
|
||||
allow_none=True,
|
||||
)
|
||||
extra = fields.String(description=extra_description, validate=extra_validator)
|
||||
extra = fields.String(
|
||||
metadata={"description": extra_description}, validate=extra_validator
|
||||
)
|
||||
server_cert = fields.String(
|
||||
description=server_cert_description,
|
||||
metadata={"description": server_cert_description},
|
||||
allow_none=True,
|
||||
validate=server_cert_validator,
|
||||
)
|
||||
sqlalchemy_uri = fields.String(
|
||||
description=sqlalchemy_uri_description,
|
||||
metadata={"description": sqlalchemy_uri_description},
|
||||
validate=[Length(1, 1024), sqlalchemy_uri_validator],
|
||||
)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, default=False)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, dump_default=False)
|
||||
external_url = fields.String(allow_none=True)
|
||||
uuid = fields.String(required=False)
|
||||
ssh_tunnel = fields.Nested(DatabaseSSHTunnel, allow_none=True)
|
||||
|
|
@ -447,41 +475,51 @@ class DatabasePutSchema(Schema, DatabaseParametersSchemaMixin):
|
|||
rename_encrypted_extra = pre_load(rename_encrypted_extra)
|
||||
|
||||
database_name = fields.String(
|
||||
description=database_name_description,
|
||||
metadata={"description": database_name_description},
|
||||
allow_none=True,
|
||||
validate=Length(1, 250),
|
||||
)
|
||||
cache_timeout = fields.Integer(
|
||||
description=cache_timeout_description, allow_none=True
|
||||
metadata={"description": cache_timeout_description}, allow_none=True
|
||||
)
|
||||
expose_in_sqllab = fields.Boolean(description=expose_in_sqllab_description)
|
||||
allow_run_async = fields.Boolean(description=allow_run_async_description)
|
||||
allow_file_upload = fields.Boolean(description=allow_file_upload_description)
|
||||
allow_ctas = fields.Boolean(description=allow_ctas_description)
|
||||
allow_cvas = fields.Boolean(description=allow_cvas_description)
|
||||
allow_dml = fields.Boolean(description=allow_dml_description)
|
||||
expose_in_sqllab = fields.Boolean(
|
||||
metadata={"description": expose_in_sqllab_description}
|
||||
)
|
||||
allow_run_async = fields.Boolean(
|
||||
metadata={"description": allow_run_async_description}
|
||||
)
|
||||
allow_file_upload = fields.Boolean(
|
||||
metadata={"description": allow_file_upload_description}
|
||||
)
|
||||
allow_ctas = fields.Boolean(metadata={"description": allow_ctas_description})
|
||||
allow_cvas = fields.Boolean(metadata={"description": allow_cvas_description})
|
||||
allow_dml = fields.Boolean(metadata={"description": allow_dml_description})
|
||||
force_ctas_schema = fields.String(
|
||||
description=force_ctas_schema_description,
|
||||
metadata={"description": force_ctas_schema_description},
|
||||
allow_none=True,
|
||||
validate=Length(0, 250),
|
||||
)
|
||||
impersonate_user = fields.Boolean(description=impersonate_user_description)
|
||||
impersonate_user = fields.Boolean(
|
||||
metadata={"description": impersonate_user_description}
|
||||
)
|
||||
masked_encrypted_extra = fields.String(
|
||||
description=encrypted_extra_description,
|
||||
metadata={"description": encrypted_extra_description},
|
||||
allow_none=True,
|
||||
validate=encrypted_extra_validator,
|
||||
)
|
||||
extra = fields.String(description=extra_description, validate=extra_validator)
|
||||
extra = fields.String(
|
||||
metadata={"description": extra_description}, validate=extra_validator
|
||||
)
|
||||
server_cert = fields.String(
|
||||
description=server_cert_description,
|
||||
metadata={"description": server_cert_description},
|
||||
allow_none=True,
|
||||
validate=server_cert_validator,
|
||||
)
|
||||
sqlalchemy_uri = fields.String(
|
||||
description=sqlalchemy_uri_description,
|
||||
metadata={"description": sqlalchemy_uri_description},
|
||||
validate=[Length(0, 1024), sqlalchemy_uri_validator],
|
||||
)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, default=False)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, dump_default=False)
|
||||
external_url = fields.String(allow_none=True)
|
||||
ssh_tunnel = fields.Nested(DatabaseSSHTunnel, allow_none=True)
|
||||
uuid = fields.String(required=False)
|
||||
|
|
@ -491,24 +529,28 @@ class DatabaseTestConnectionSchema(Schema, DatabaseParametersSchemaMixin):
|
|||
rename_encrypted_extra = pre_load(rename_encrypted_extra)
|
||||
|
||||
database_name = fields.String(
|
||||
description=database_name_description,
|
||||
metadata={"description": database_name_description},
|
||||
allow_none=True,
|
||||
validate=Length(1, 250),
|
||||
)
|
||||
impersonate_user = fields.Boolean(description=impersonate_user_description)
|
||||
extra = fields.String(description=extra_description, validate=extra_validator)
|
||||
impersonate_user = fields.Boolean(
|
||||
metadata={"description": impersonate_user_description}
|
||||
)
|
||||
extra = fields.String(
|
||||
metadata={"description": extra_description}, validate=extra_validator
|
||||
)
|
||||
masked_encrypted_extra = fields.String(
|
||||
description=encrypted_extra_description,
|
||||
metadata={"description": encrypted_extra_description},
|
||||
validate=encrypted_extra_validator,
|
||||
allow_none=True,
|
||||
)
|
||||
server_cert = fields.String(
|
||||
description=server_cert_description,
|
||||
metadata={"description": server_cert_description},
|
||||
allow_none=True,
|
||||
validate=server_cert_validator,
|
||||
)
|
||||
sqlalchemy_uri = fields.String(
|
||||
description=sqlalchemy_uri_description,
|
||||
metadata={"description": sqlalchemy_uri_description},
|
||||
validate=[Length(1, 1024), sqlalchemy_uri_validator],
|
||||
)
|
||||
|
||||
|
|
@ -524,20 +566,27 @@ class TableMetadataOptionsResponseSchema(Schema):
|
|||
|
||||
|
||||
class TableMetadataColumnsResponseSchema(Schema):
|
||||
keys = fields.List(fields.String(), description="")
|
||||
longType = fields.String(description="The actual backend long type for the column")
|
||||
name = fields.String(description="The column name")
|
||||
type = fields.String(description="The column type")
|
||||
keys = fields.List(fields.String(), metadata={"description": ""})
|
||||
longType = fields.String(
|
||||
metadata={"description": "The actual backend long type for the column"}
|
||||
)
|
||||
name = fields.String(metadata={"description": "The column name"})
|
||||
type = fields.String(metadata={"description": "The column type"})
|
||||
duplicates_constraint = fields.String(required=False)
|
||||
|
||||
|
||||
class TableMetadataForeignKeysIndexesResponseSchema(Schema):
|
||||
column_names = fields.List(
|
||||
fields.String(
|
||||
description="A list of column names that compose the foreign key or index"
|
||||
metadata={
|
||||
"description": "A list of column names that compose the foreign key or "
|
||||
" index"
|
||||
}
|
||||
)
|
||||
)
|
||||
name = fields.String(description="The name of the foreign key or index")
|
||||
name = fields.String(
|
||||
metadata={"description": "The name of the foreign key or index"}
|
||||
)
|
||||
options = fields.Nested(TableMetadataOptionsResponseSchema)
|
||||
referred_columns = fields.List(fields.String())
|
||||
referred_schema = fields.String()
|
||||
|
|
@ -547,30 +596,35 @@ class TableMetadataForeignKeysIndexesResponseSchema(Schema):
|
|||
|
||||
class TableMetadataPrimaryKeyResponseSchema(Schema):
|
||||
column_names = fields.List(
|
||||
fields.String(description="A list of column names that compose the primary key")
|
||||
fields.String(
|
||||
metadata={
|
||||
"description": "A list of column names that compose the primary key"
|
||||
}
|
||||
)
|
||||
)
|
||||
name = fields.String(description="The primary key index name")
|
||||
name = fields.String(metadata={"description": "The primary key index name"})
|
||||
type = fields.String()
|
||||
|
||||
|
||||
class TableMetadataResponseSchema(Schema):
|
||||
name = fields.String(description="The name of the table")
|
||||
name = fields.String(metadata={"description": "The name of the table"})
|
||||
columns = fields.List(
|
||||
fields.Nested(TableMetadataColumnsResponseSchema),
|
||||
description="A list of columns and their metadata",
|
||||
metadata={"description": "A list of columns and their metadata"},
|
||||
)
|
||||
foreignKeys = fields.List(
|
||||
fields.Nested(TableMetadataForeignKeysIndexesResponseSchema),
|
||||
description="A list of foreign keys and their metadata",
|
||||
metadata={"description": "A list of foreign keys and their metadata"},
|
||||
)
|
||||
indexes = fields.List(
|
||||
fields.Nested(TableMetadataForeignKeysIndexesResponseSchema),
|
||||
description="A list of indexes and their metadata",
|
||||
metadata={"description": "A list of indexes and their metadata"},
|
||||
)
|
||||
primaryKey = fields.Nested(
|
||||
TableMetadataPrimaryKeyResponseSchema, description="Primary keys metadata"
|
||||
TableMetadataPrimaryKeyResponseSchema,
|
||||
metadata={"description": "Primary keys metadata"},
|
||||
)
|
||||
selectStar = fields.String(description="SQL select star")
|
||||
selectStar = fields.String(metadata={"description": "SQL select star"})
|
||||
|
||||
|
||||
class TableExtraMetadataResponseSchema(Schema):
|
||||
|
|
@ -580,21 +634,27 @@ class TableExtraMetadataResponseSchema(Schema):
|
|||
|
||||
|
||||
class SelectStarResponseSchema(Schema):
|
||||
result = fields.String(description="SQL select star")
|
||||
result = fields.String(metadata={"description": "SQL select star"})
|
||||
|
||||
|
||||
class SchemasResponseSchema(Schema):
|
||||
result = fields.List(fields.String(description="A database schema name"))
|
||||
result = fields.List(
|
||||
fields.String(metadata={"description": "A database schema name"})
|
||||
)
|
||||
|
||||
|
||||
class DatabaseTablesResponse(Schema):
|
||||
extra = fields.Dict(description="Extra data used to specify column metadata")
|
||||
type = fields.String(description="table or view")
|
||||
value = fields.String(description="The table or view name")
|
||||
extra = fields.Dict(
|
||||
metadata={"description": "Extra data used to specify column metadata"}
|
||||
)
|
||||
type = fields.String(metadata={"description": "table or view"})
|
||||
value = fields.String(metadata={"description": "The table or view name"})
|
||||
|
||||
|
||||
class ValidateSQLRequest(Schema):
|
||||
sql = fields.String(required=True, description="SQL statement to validate")
|
||||
sql = fields.String(
|
||||
required=True, metadata={"description": "SQL statement to validate"}
|
||||
)
|
||||
schema = fields.String(required=False, allow_none=True)
|
||||
template_params = fields.Dict(required=False, allow_none=True)
|
||||
|
||||
|
|
@ -620,16 +680,18 @@ class DatabaseRelatedDashboard(Schema):
|
|||
|
||||
|
||||
class DatabaseRelatedCharts(Schema):
|
||||
count = fields.Integer(description="Chart count")
|
||||
count = fields.Integer(metadata={"description": "Chart count"})
|
||||
result = fields.List(
|
||||
fields.Nested(DatabaseRelatedChart), description="A list of dashboards"
|
||||
fields.Nested(DatabaseRelatedChart),
|
||||
metadata={"description": "A list of dashboards"},
|
||||
)
|
||||
|
||||
|
||||
class DatabaseRelatedDashboards(Schema):
|
||||
count = fields.Integer(description="Dashboard count")
|
||||
count = fields.Integer(metadata={"description": "Dashboard count"})
|
||||
result = fields.List(
|
||||
fields.Nested(DatabaseRelatedDashboard), description="A list of dashboards"
|
||||
fields.Nested(DatabaseRelatedDashboard),
|
||||
metadata={"description": "A list of dashboards"},
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -708,7 +770,7 @@ class ImportV1DatabaseSchema(Schema):
|
|||
extra = fields.Nested(ImportV1DatabaseExtraSchema)
|
||||
uuid = fields.UUID(required=True)
|
||||
version = fields.String(required=True)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, default=False)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, dump_default=False)
|
||||
external_url = fields.String(allow_none=True)
|
||||
ssh_tunnel = fields.Nested(DatabaseSSHTunnel, allow_none=True)
|
||||
|
||||
|
|
@ -813,5 +875,8 @@ def encrypted_field_properties(self, field: Any, **_) -> Dict[str, Any]: # type
|
|||
class DatabaseSchemaAccessForFileUploadResponse(Schema):
|
||||
schemas = fields.List(
|
||||
fields.String(),
|
||||
description="The list of schemas allowed for the database to upload information",
|
||||
metadata={
|
||||
"description": "The list of schemas allowed for the database to upload "
|
||||
"information"
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -49,14 +49,14 @@ class DatasetColumnsPutSchema(Schema):
|
|||
column_name = fields.String(required=True, validate=Length(1, 255))
|
||||
type = fields.String(allow_none=True)
|
||||
advanced_data_type = fields.String(allow_none=True, validate=Length(1, 255))
|
||||
verbose_name = fields.String(allow_none=True, Length=(1, 1024))
|
||||
verbose_name = fields.String(allow_none=True, metadata={Length: (1, 1024)})
|
||||
description = fields.String(allow_none=True)
|
||||
expression = fields.String(allow_none=True)
|
||||
extra = fields.String(allow_none=True)
|
||||
filterable = fields.Boolean()
|
||||
groupby = fields.Boolean()
|
||||
is_active = fields.Boolean(allow_none=True)
|
||||
is_dttm = fields.Boolean(default=False)
|
||||
is_dttm = fields.Boolean(dump_default=False)
|
||||
python_date_format = fields.String(
|
||||
allow_none=True, validate=[Length(1, 255), validate_python_date_format]
|
||||
)
|
||||
|
|
@ -71,7 +71,7 @@ class DatasetMetricsPutSchema(Schema):
|
|||
metric_name = fields.String(required=True, validate=Length(1, 255))
|
||||
metric_type = fields.String(allow_none=True, validate=Length(1, 32))
|
||||
d3format = fields.String(allow_none=True, validate=Length(1, 128))
|
||||
verbose_name = fields.String(allow_none=True, Length=(1, 1024))
|
||||
verbose_name = fields.String(allow_none=True, metadata={Length: (1, 1024)})
|
||||
warning_text = fields.String(allow_none=True)
|
||||
uuid = fields.UUID(allow_none=True)
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ class DatasetPostSchema(Schema):
|
|||
table_name = fields.String(required=True, allow_none=False, validate=Length(1, 250))
|
||||
sql = fields.String(allow_none=True)
|
||||
owners = fields.List(fields.Integer())
|
||||
is_managed_externally = fields.Boolean(allow_none=True, default=False)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, dump_default=False)
|
||||
external_url = fields.String(allow_none=True)
|
||||
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ 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)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, dump_default=False)
|
||||
external_url = fields.String(allow_none=True)
|
||||
|
||||
|
||||
|
|
@ -127,16 +127,18 @@ class DatasetRelatedDashboard(Schema):
|
|||
|
||||
|
||||
class DatasetRelatedCharts(Schema):
|
||||
count = fields.Integer(description="Chart count")
|
||||
count = fields.Integer(metadata={"description": "Chart count"})
|
||||
result = fields.List(
|
||||
fields.Nested(DatasetRelatedChart), description="A list of dashboards"
|
||||
fields.Nested(DatasetRelatedChart),
|
||||
metadata={"description": "A list of dashboards"},
|
||||
)
|
||||
|
||||
|
||||
class DatasetRelatedDashboards(Schema):
|
||||
count = fields.Integer(description="Dashboard count")
|
||||
count = fields.Integer(metadata={"description": "Dashboard count"})
|
||||
result = fields.List(
|
||||
fields.Nested(DatasetRelatedDashboard), description="A list of dashboards"
|
||||
fields.Nested(DatasetRelatedDashboard),
|
||||
metadata={"description": "A list of dashboards"},
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -160,8 +162,8 @@ class ImportV1ColumnSchema(Schema):
|
|||
column_name = fields.String(required=True)
|
||||
extra = fields.Dict(allow_none=True)
|
||||
verbose_name = fields.String(allow_none=True)
|
||||
is_dttm = fields.Boolean(default=False, allow_none=True)
|
||||
is_active = fields.Boolean(default=True, allow_none=True)
|
||||
is_dttm = fields.Boolean(dump_default=False, allow_none=True)
|
||||
is_active = fields.Boolean(dump_default=True, allow_none=True)
|
||||
type = fields.String(allow_none=True)
|
||||
advanced_data_type = fields.String(allow_none=True)
|
||||
groupby = fields.Boolean()
|
||||
|
|
@ -224,19 +226,21 @@ class ImportV1DatasetSchema(Schema):
|
|||
version = fields.String(required=True)
|
||||
database_uuid = fields.UUID(required=True)
|
||||
data = fields.URL()
|
||||
is_managed_externally = fields.Boolean(allow_none=True, default=False)
|
||||
is_managed_externally = fields.Boolean(allow_none=True, dump_default=False)
|
||||
external_url = fields.String(allow_none=True)
|
||||
|
||||
|
||||
class GetOrCreateDatasetSchema(Schema):
|
||||
table_name = fields.String(required=True, description="Name of table")
|
||||
table_name = fields.String(required=True, metadata={"description": "Name of table"})
|
||||
database_id = fields.Integer(
|
||||
required=True, description="ID of database table belongs to"
|
||||
required=True, metadata={"description": "ID of database table belongs to"}
|
||||
)
|
||||
schema = fields.String(
|
||||
description="The schema the table belongs to", allow_none=True
|
||||
metadata={"description": "The schema the table belongs to"}, allow_none=True
|
||||
)
|
||||
template_params = fields.String(
|
||||
metadata={"description": "Template params for the table"}
|
||||
)
|
||||
template_params = fields.String(description="Template params for the table")
|
||||
|
||||
|
||||
class DatasetSchema(SQLAlchemyAutoSchema):
|
||||
|
|
|
|||
|
|
@ -1859,20 +1859,29 @@ class BaseEngineSpec: # pylint: disable=too-many-public-methods
|
|||
# schema for adding a database by providing parameters instead of the
|
||||
# full SQLAlchemy URI
|
||||
class BasicParametersSchema(Schema):
|
||||
username = fields.String(required=True, allow_none=True, description=__("Username"))
|
||||
password = fields.String(allow_none=True, description=__("Password"))
|
||||
host = fields.String(required=True, description=__("Hostname or IP address"))
|
||||
username = fields.String(
|
||||
required=True, allow_none=True, metadata={"description": __("Username")}
|
||||
)
|
||||
password = fields.String(allow_none=True, metadata={"description": __("Password")})
|
||||
host = fields.String(
|
||||
required=True, metadata={"description": __("Hostname or IP address")}
|
||||
)
|
||||
port = fields.Integer(
|
||||
required=True,
|
||||
description=__("Database port"),
|
||||
metadata={"description": __("Database port")},
|
||||
validate=Range(min=0, max=2**16, max_inclusive=False),
|
||||
)
|
||||
database = fields.String(required=True, description=__("Database name"))
|
||||
database = fields.String(
|
||||
required=True, metadata={"description": __("Database name")}
|
||||
)
|
||||
query = fields.Dict(
|
||||
keys=fields.Str(), values=fields.Raw(), description=__("Additional parameters")
|
||||
keys=fields.Str(),
|
||||
values=fields.Raw(),
|
||||
metadata={"description": __("Additional parameters")},
|
||||
)
|
||||
encryption = fields.Boolean(
|
||||
required=False, description=__("Use an encrypted connection to the database")
|
||||
required=False,
|
||||
metadata={"description": __("Use an encrypted connection to the database")},
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ ma_plugin = MarshmallowPlugin()
|
|||
class BigQueryParametersSchema(Schema):
|
||||
credentials_info = EncryptedString(
|
||||
required=False,
|
||||
description="Contents of BigQuery JSON credentials.",
|
||||
metadata={"description": "Contents of BigQuery JSON credentials."},
|
||||
)
|
||||
query = fields.Dict(required=False)
|
||||
|
||||
|
|
|
|||
|
|
@ -198,20 +198,27 @@ class ClickHouseEngineSpec(ClickHouseBaseEngineSpec):
|
|||
|
||||
|
||||
class ClickHouseParametersSchema(Schema):
|
||||
username = fields.String(allow_none=True, description=__("Username"))
|
||||
password = fields.String(allow_none=True, description=__("Password"))
|
||||
host = fields.String(required=True, description=__("Hostname or IP address"))
|
||||
username = fields.String(allow_none=True, metadata={"description": __("Username")})
|
||||
password = fields.String(allow_none=True, metadata={"description": __("Password")})
|
||||
host = fields.String(
|
||||
required=True, metadata={"description": __("Hostname or IP address")}
|
||||
)
|
||||
port = fields.Integer(
|
||||
allow_none=True,
|
||||
description=__("Database port"),
|
||||
metadata={"description": __("Database port")},
|
||||
validate=Range(min=0, max=65535),
|
||||
)
|
||||
database = fields.String(allow_none=True, description=__("Database name"))
|
||||
database = fields.String(
|
||||
allow_none=True, metadata={"description": __("Database name")}
|
||||
)
|
||||
encryption = fields.Boolean(
|
||||
default=True, description=__("Use an encrypted connection to the database")
|
||||
dump_default=True,
|
||||
metadata={"description": __("Use an encrypted connection to the database")},
|
||||
)
|
||||
query = fields.Dict(
|
||||
keys=fields.Str(), values=fields.Raw(), description=__("Additional parameters")
|
||||
keys=fields.Str(),
|
||||
values=fields.Raw(),
|
||||
metadata={"description": __("Additional parameters")},
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -49,12 +49,13 @@ class DatabricksParametersSchema(Schema):
|
|||
host = fields.Str(required=True)
|
||||
port = fields.Integer(
|
||||
required=True,
|
||||
description=__("Database port"),
|
||||
metadata={"description": __("Database port")},
|
||||
validate=Range(min=0, max=2**16, max_inclusive=False),
|
||||
)
|
||||
database = fields.Str(required=True)
|
||||
encryption = fields.Boolean(
|
||||
required=False, description=__("Use an encrypted connection to the database")
|
||||
required=False,
|
||||
metadata={"description": __("Use an encrypted connection to the database")},
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -47,8 +47,10 @@ class GSheetsParametersSchema(Schema):
|
|||
catalog = fields.Dict()
|
||||
service_account_info = EncryptedString(
|
||||
required=False,
|
||||
description="Contents of GSheets JSON credentials.",
|
||||
field_name="service_account_info",
|
||||
metadata={
|
||||
"description": "Contents of GSheets JSON credentials.",
|
||||
"field_name": "service_account_info",
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,31 +21,35 @@ from superset.utils.core import DatasourceType
|
|||
|
||||
class FormDataPostSchema(Schema):
|
||||
datasource_id = fields.Integer(
|
||||
required=True, allow_none=False, description="The datasource ID"
|
||||
required=True, allow_none=False, metadata={"description": "The datasource ID"}
|
||||
)
|
||||
datasource_type = fields.String(
|
||||
required=True,
|
||||
allow_none=False,
|
||||
description="The datasource type",
|
||||
metadata={"description": "The datasource type"},
|
||||
validate=validate.OneOf(choices=[ds.value for ds in DatasourceType]),
|
||||
)
|
||||
chart_id = fields.Integer(required=False, description="The chart ID")
|
||||
chart_id = fields.Integer(required=False, metadata={"description": "The chart ID"})
|
||||
form_data = fields.String(
|
||||
required=True, allow_none=False, description="Any type of JSON supported text."
|
||||
required=True,
|
||||
allow_none=False,
|
||||
metadata={"description": "Any type of JSON supported text."},
|
||||
)
|
||||
|
||||
|
||||
class FormDataPutSchema(Schema):
|
||||
datasource_id = fields.Integer(
|
||||
required=True, allow_none=False, description="The datasource ID"
|
||||
required=True, allow_none=False, metadata={"description": "The datasource ID"}
|
||||
)
|
||||
datasource_type = fields.String(
|
||||
required=True,
|
||||
allow_none=False,
|
||||
description="The datasource type",
|
||||
metadata={"description": "The datasource type"},
|
||||
validate=validate.OneOf(choices=[ds.value for ds in DatasourceType]),
|
||||
)
|
||||
chart_id = fields.Integer(required=False, description="The chart ID")
|
||||
chart_id = fields.Integer(required=False, metadata={"description": "The chart ID"})
|
||||
form_data = fields.String(
|
||||
required=True, allow_none=False, description="Any type of JSON supported text."
|
||||
required=True,
|
||||
allow_none=False,
|
||||
metadata={"description": "Any type of JSON supported text."},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -21,19 +21,23 @@ class ExplorePermalinkPostSchema(Schema):
|
|||
formData = fields.Dict(
|
||||
required=True,
|
||||
allow_none=False,
|
||||
description="Chart form data",
|
||||
metadata={"description": "Chart form data"},
|
||||
)
|
||||
urlParams = fields.List(
|
||||
fields.Tuple(
|
||||
(
|
||||
fields.String(required=True, allow_none=True, description="Key"),
|
||||
fields.String(required=True, allow_none=True, description="Value"),
|
||||
fields.String(
|
||||
required=True, allow_none=True, metadata={"description": "Key"}
|
||||
),
|
||||
fields.String(
|
||||
required=True, allow_none=True, metadata={"description": "Value"}
|
||||
),
|
||||
),
|
||||
required=False,
|
||||
allow_none=True,
|
||||
description="URL Parameter key-value pair",
|
||||
metadata={"description": "URL Parameter key-value pair"},
|
||||
),
|
||||
required=False,
|
||||
allow_none=True,
|
||||
description="URL Parameters",
|
||||
metadata={"description": "URL Parameters"},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -19,96 +19,146 @@ from marshmallow import fields, Schema
|
|||
|
||||
class DatasetSchema(Schema):
|
||||
cache_timeout = fields.Integer(
|
||||
description="Duration (in seconds) of the caching timeout for this dataset."
|
||||
metadata={
|
||||
"description": "Duration (in seconds) of the caching timeout for this "
|
||||
"dataset."
|
||||
}
|
||||
)
|
||||
column_formats = fields.Dict(metadata={"description": "Column formats."})
|
||||
columns = fields.List(fields.Dict(), metadata={"description": "Columns metadata."})
|
||||
database = fields.Dict(
|
||||
metadata={"description": "Database associated with the dataset."}
|
||||
)
|
||||
datasource_name = fields.String(metadata={"description": "Dataset name."})
|
||||
default_endpoint = fields.String(
|
||||
metadata={"description": "Default endpoint for the dataset."}
|
||||
)
|
||||
description = fields.String(metadata={"description": "Dataset description."})
|
||||
edit_url = fields.String(
|
||||
metadata={"description": "The URL for editing the dataset."}
|
||||
)
|
||||
column_formats = fields.Dict(description="Column formats.")
|
||||
columns = fields.List(fields.Dict(), description="Columns metadata.")
|
||||
database = fields.Dict(description="Database associated with the dataset.")
|
||||
datasource_name = fields.String(description="Dataset name.")
|
||||
default_endpoint = fields.String(description="Default endpoint for the dataset.")
|
||||
description = fields.String(description="Dataset description.")
|
||||
edit_url = fields.String(description="The URL for editing the dataset.")
|
||||
extra = fields.Dict(
|
||||
description="JSON string containing extra configuration elements."
|
||||
metadata={"description": "JSON string containing extra configuration elements."}
|
||||
)
|
||||
fetch_values_predicate = fields.String(
|
||||
description="Predicate used when fetching values from the dataset."
|
||||
metadata={
|
||||
"description": "Predicate used when fetching values from the dataset."
|
||||
}
|
||||
)
|
||||
filter_select = fields.Bool(
|
||||
metadata={"description": "SELECT filter applied to the dataset."}
|
||||
)
|
||||
filter_select_enabled = fields.Bool(
|
||||
metadata={"description": "If the SELECT filter is enabled."}
|
||||
)
|
||||
filter_select = fields.Bool(description="SELECT filter applied to the dataset.")
|
||||
filter_select_enabled = fields.Bool(description="If the SELECT filter is enabled.")
|
||||
granularity_sqla = fields.List(
|
||||
fields.List(fields.Dict()),
|
||||
description=(
|
||||
"Name of temporal column used for time filtering for SQL datasources. "
|
||||
"This field is deprecated, use `granularity` instead."
|
||||
),
|
||||
metadata={
|
||||
"description": (
|
||||
"Name of temporal column used for time filtering for SQL datasources. "
|
||||
"This field is deprecated, use `granularity` instead."
|
||||
)
|
||||
},
|
||||
)
|
||||
health_check_message = fields.String(description="Health check message.")
|
||||
id = fields.Integer(description="Dataset ID.")
|
||||
is_sqllab_view = fields.Bool(description="If the dataset is a SQL Lab view.")
|
||||
main_dttm_col = fields.String(description="The main temporal column.")
|
||||
metrics = fields.List(fields.Dict(), description="Dataset metrics.")
|
||||
name = fields.String(description="Dataset name.")
|
||||
offset = fields.Integer(description="Dataset offset.")
|
||||
health_check_message = fields.String(
|
||||
metadata={"description": "Health check message."}
|
||||
)
|
||||
id = fields.Integer(metadata={"description": "Dataset ID."})
|
||||
is_sqllab_view = fields.Bool(
|
||||
metadata={"description": "If the dataset is a SQL Lab view."}
|
||||
)
|
||||
main_dttm_col = fields.String(metadata={"description": "The main temporal column."})
|
||||
metrics = fields.List(fields.Dict(), metadata={"description": "Dataset metrics."})
|
||||
name = fields.String(metadata={"description": "Dataset name."})
|
||||
offset = fields.Integer(metadata={"description": "Dataset offset."})
|
||||
order_by_choices = fields.List(
|
||||
fields.List(fields.String()), description="List of order by columns."
|
||||
fields.List(fields.String()),
|
||||
metadata={"description": "List of order by columns."},
|
||||
)
|
||||
owners = fields.List(
|
||||
fields.Integer(), metadata={"description": "List of owners identifiers"}
|
||||
)
|
||||
params = fields.Dict(metadata={"description": "Extra params for the dataset."})
|
||||
perm = fields.String(metadata={"description": "Permission expression."})
|
||||
schema = fields.String(metadata={"description": "Dataset schema."})
|
||||
select_star = fields.String(metadata={"description": "Select all clause."})
|
||||
sql = fields.String(
|
||||
metadata={"description": "A SQL statement that defines the dataset."}
|
||||
)
|
||||
owners = fields.List(fields.Integer(), description="List of owners identifiers")
|
||||
params = fields.Dict(description="Extra params for the dataset.")
|
||||
perm = fields.String(description="Permission expression.")
|
||||
schema = fields.String(description="Dataset schema.")
|
||||
select_star = fields.String(description="Select all clause.")
|
||||
sql = fields.String(description="A SQL statement that defines the dataset.")
|
||||
table_name = fields.String(
|
||||
description="The name of the table associated with the dataset."
|
||||
metadata={"description": "The name of the table associated with the dataset."}
|
||||
)
|
||||
template_params = fields.Dict(description="Table template params.")
|
||||
template_params = fields.Dict(metadata={"description": "Table template params."})
|
||||
time_grain_sqla = fields.List(
|
||||
fields.List(fields.String()),
|
||||
description="List of temporal granularities supported by the dataset.",
|
||||
metadata={
|
||||
"description": "List of temporal granularities supported by the dataset."
|
||||
},
|
||||
)
|
||||
type = fields.String(metadata={"description": "Dataset type."})
|
||||
uid = fields.String(metadata={"description": "Dataset unique identifier."})
|
||||
verbose_map = fields.Dict(
|
||||
metadata={"description": "Mapping from raw name to verbose name."}
|
||||
)
|
||||
type = fields.String(description="Dataset type.")
|
||||
uid = fields.String(description="Dataset unique identifier.")
|
||||
verbose_map = fields.Dict(description="Mapping from raw name to verbose name.")
|
||||
|
||||
|
||||
class SliceSchema(Schema):
|
||||
cache_timeout = fields.Integer(
|
||||
description="Duration (in seconds) of the caching timeout for this chart."
|
||||
metadata={
|
||||
"description": "Duration (in seconds) of the caching timeout for this chart."
|
||||
}
|
||||
)
|
||||
certification_details = fields.String(
|
||||
metadata={"description": "Details of the certification."}
|
||||
)
|
||||
certification_details = fields.String(description="Details of the certification.")
|
||||
certified_by = fields.String(
|
||||
description="Person or group that has certified this dashboard."
|
||||
metadata={"description": "Person or group that has certified this dashboard."}
|
||||
)
|
||||
changed_on = fields.String(
|
||||
metadata={"description": "Timestamp of the last modification."}
|
||||
)
|
||||
changed_on = fields.String(description="Timestamp of the last modification.")
|
||||
changed_on_humanized = fields.String(
|
||||
description="Timestamp of the last modification in human readable form."
|
||||
metadata={
|
||||
"description": "Timestamp of the last modification in human readable form."
|
||||
}
|
||||
)
|
||||
datasource = fields.String(description="Datasource identifier.")
|
||||
description = fields.String(description="Slice description.")
|
||||
datasource = fields.String(metadata={"description": "Datasource identifier."})
|
||||
description = fields.String(metadata={"description": "Slice description."})
|
||||
description_markeddown = fields.String(
|
||||
description="Sanitized HTML version of the chart description."
|
||||
metadata={"description": "Sanitized HTML version of the chart description."}
|
||||
)
|
||||
edit_url = fields.String(metadata={"description": "The URL for editing the slice."})
|
||||
form_data = fields.Dict(
|
||||
metadata={"description": "Form data associated with the slice."}
|
||||
)
|
||||
edit_url = fields.String(description="The URL for editing the slice.")
|
||||
form_data = fields.Dict(description="Form data associated with the slice.")
|
||||
is_managed_externally = fields.Bool(
|
||||
description="If the chart is managed outside externally."
|
||||
metadata={"description": "If the chart is managed outside externally."}
|
||||
)
|
||||
modified = fields.String(description="Last modification in human readable form.")
|
||||
owners = fields.List(fields.Integer(), description="Owners identifiers.")
|
||||
query_context = fields.Dict(description="The context associated with the query.")
|
||||
slice_id = fields.Integer(description="The slice ID.")
|
||||
slice_name = fields.String(description="The slice name.")
|
||||
slice_url = fields.String(description="The slice URL.")
|
||||
modified = fields.String(
|
||||
metadata={"description": "Last modification in human readable form."}
|
||||
)
|
||||
owners = fields.List(
|
||||
fields.Integer(), metadata={"description": "Owners identifiers."}
|
||||
)
|
||||
query_context = fields.Dict(
|
||||
metadata={"description": "The context associated with the query."}
|
||||
)
|
||||
slice_id = fields.Integer(metadata={"description": "The slice ID."})
|
||||
slice_name = fields.String(metadata={"description": "The slice name."})
|
||||
slice_url = fields.String(metadata={"description": "The slice URL."})
|
||||
|
||||
|
||||
class ExploreContextSchema(Schema):
|
||||
form_data = fields.Dict(
|
||||
description=(
|
||||
"Form data from the Explore controls used to form the "
|
||||
"chart's data query."
|
||||
)
|
||||
metadata={
|
||||
"description": (
|
||||
"Form data from the Explore controls used to form the "
|
||||
"chart's data query."
|
||||
)
|
||||
}
|
||||
)
|
||||
dataset = fields.Nested(DatasetSchema)
|
||||
slice = fields.Nested(SliceSchema)
|
||||
message = fields.String(description="Any message related to the processed request.")
|
||||
message = fields.String(
|
||||
metadata={"description": "Any message related to the processed request."}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ def validate_crontab(value: Union[bytes, bytearray, str]) -> None:
|
|||
|
||||
class ValidatorConfigJSONSchema(Schema):
|
||||
op = fields.String( # pylint: disable=invalid-name
|
||||
description=validator_config_json_op_description,
|
||||
metadata={"description": validator_config_json_op_description},
|
||||
validate=validate.OneOf(choices=["<", "<=", ">", ">=", "==", "!="]),
|
||||
)
|
||||
threshold = fields.Float()
|
||||
|
|
@ -113,7 +113,7 @@ class ReportRecipientConfigJSONSchema(Schema):
|
|||
|
||||
class ReportRecipientSchema(Schema):
|
||||
type = fields.String(
|
||||
description="The recipient type, check spec for valid options",
|
||||
metadata={"description": "The recipient type, check spec for valid options"},
|
||||
allow_none=False,
|
||||
required=True,
|
||||
validate=validate.OneOf(
|
||||
|
|
@ -125,88 +125,90 @@ class ReportRecipientSchema(Schema):
|
|||
|
||||
class ReportSchedulePostSchema(Schema):
|
||||
type = fields.String(
|
||||
description=type_description,
|
||||
metadata={"description": type_description},
|
||||
allow_none=False,
|
||||
required=True,
|
||||
validate=validate.OneOf(choices=tuple(key.value for key in ReportScheduleType)),
|
||||
)
|
||||
name = fields.String(
|
||||
description=name_description,
|
||||
metadata={"description": name_description, "example": "Daily dashboard email"},
|
||||
allow_none=False,
|
||||
required=True,
|
||||
validate=[Length(1, 150)],
|
||||
example="Daily dashboard email",
|
||||
)
|
||||
description = fields.String(
|
||||
description=description_description,
|
||||
metadata={
|
||||
"description": description_description,
|
||||
"example": "Daily sales dashboard to marketing",
|
||||
},
|
||||
allow_none=True,
|
||||
required=False,
|
||||
example="Daily sales dashboard to marketing",
|
||||
)
|
||||
context_markdown = fields.String(
|
||||
description=context_markdown_description, allow_none=True, required=False
|
||||
metadata={"description": context_markdown_description},
|
||||
allow_none=True,
|
||||
required=False,
|
||||
)
|
||||
active = fields.Boolean()
|
||||
crontab = fields.String(
|
||||
description=crontab_description,
|
||||
metadata={"description": crontab_description, "example": "*/5 * * * *"},
|
||||
validate=[validate_crontab, Length(1, 1000)],
|
||||
example="*/5 * * * *",
|
||||
allow_none=False,
|
||||
required=True,
|
||||
)
|
||||
timezone = fields.String(
|
||||
description=timezone_description,
|
||||
default="UTC",
|
||||
metadata={"description": timezone_description},
|
||||
dump_default="UTC",
|
||||
validate=validate.OneOf(choices=tuple(all_timezones)),
|
||||
)
|
||||
sql = fields.String(
|
||||
description=sql_description, example="SELECT value FROM time_series_table"
|
||||
metadata={
|
||||
"description": sql_description,
|
||||
"example": "SELECT value FROM time_series_table",
|
||||
}
|
||||
)
|
||||
chart = fields.Integer(required=False, allow_none=True)
|
||||
creation_method = EnumField(
|
||||
ReportCreationMethod,
|
||||
by_value=True,
|
||||
required=False,
|
||||
description=creation_method_description,
|
||||
metadata={"description": creation_method_description},
|
||||
)
|
||||
dashboard = fields.Integer(required=False, allow_none=True)
|
||||
selected_tabs = fields.List(fields.Integer(), required=False, allow_none=True)
|
||||
database = fields.Integer(required=False)
|
||||
owners = fields.List(fields.Integer(description=owners_description))
|
||||
owners = fields.List(fields.Integer(metadata={"description": owners_description}))
|
||||
validator_type = fields.String(
|
||||
description=validator_type_description,
|
||||
metadata={"description": validator_type_description},
|
||||
validate=validate.OneOf(
|
||||
choices=tuple(key.value for key in ReportScheduleValidatorType)
|
||||
),
|
||||
)
|
||||
validator_config_json = fields.Nested(ValidatorConfigJSONSchema)
|
||||
log_retention = fields.Integer(
|
||||
description=log_retention_description,
|
||||
example=90,
|
||||
metadata={"description": log_retention_description, "example": 90},
|
||||
validate=[Range(min=1, error=_("Value must be greater than 0"))],
|
||||
)
|
||||
grace_period = fields.Integer(
|
||||
description=grace_period_description,
|
||||
example=60 * 60 * 4,
|
||||
default=60 * 60 * 4,
|
||||
metadata={"description": grace_period_description, "example": 60 * 60 * 4},
|
||||
dump_default=60 * 60 * 4,
|
||||
validate=[Range(min=1, error=_("Value must be greater than 0"))],
|
||||
)
|
||||
working_timeout = fields.Integer(
|
||||
description=working_timeout_description,
|
||||
example=60 * 60 * 1,
|
||||
default=60 * 60 * 1,
|
||||
metadata={"description": working_timeout_description, "example": 60 * 60 * 1},
|
||||
dump_default=60 * 60 * 1,
|
||||
validate=[Range(min=1, error=_("Value must be greater than 0"))],
|
||||
)
|
||||
|
||||
recipients = fields.List(fields.Nested(ReportRecipientSchema))
|
||||
report_format = fields.String(
|
||||
default=ReportDataFormat.VISUALIZATION,
|
||||
dump_default=ReportDataFormat.VISUALIZATION,
|
||||
validate=validate.OneOf(choices=tuple(key.value for key in ReportDataFormat)),
|
||||
)
|
||||
extra = fields.Dict(
|
||||
default=None,
|
||||
dump_default=None,
|
||||
)
|
||||
force_screenshot = fields.Boolean(default=False)
|
||||
force_screenshot = fields.Boolean(dump_default=False)
|
||||
|
||||
@validates_schema
|
||||
def validate_report_references( # pylint: disable=unused-argument,no-self-use
|
||||
|
|
@ -221,36 +223,44 @@ class ReportSchedulePostSchema(Schema):
|
|||
|
||||
class ReportSchedulePutSchema(Schema):
|
||||
type = fields.String(
|
||||
description=type_description,
|
||||
metadata={"description": type_description},
|
||||
required=False,
|
||||
validate=validate.OneOf(choices=tuple(key.value for key in ReportScheduleType)),
|
||||
)
|
||||
name = fields.String(
|
||||
description=name_description, required=False, validate=[Length(1, 150)]
|
||||
metadata={"description": name_description},
|
||||
required=False,
|
||||
validate=[Length(1, 150)],
|
||||
)
|
||||
description = fields.String(
|
||||
description=description_description,
|
||||
metadata={
|
||||
"description": description_description,
|
||||
"example": "Daily sales dashboard to marketing",
|
||||
},
|
||||
allow_none=True,
|
||||
required=False,
|
||||
example="Daily sales dashboard to marketing",
|
||||
)
|
||||
context_markdown = fields.String(
|
||||
description=context_markdown_description, allow_none=True, required=False
|
||||
metadata={"description": context_markdown_description},
|
||||
allow_none=True,
|
||||
required=False,
|
||||
)
|
||||
active = fields.Boolean(required=False)
|
||||
crontab = fields.String(
|
||||
description=crontab_description,
|
||||
metadata={"description": crontab_description},
|
||||
validate=[validate_crontab, Length(1, 1000)],
|
||||
required=False,
|
||||
)
|
||||
timezone = fields.String(
|
||||
description=timezone_description,
|
||||
default="UTC",
|
||||
metadata={"description": timezone_description},
|
||||
dump_default="UTC",
|
||||
validate=validate.OneOf(choices=tuple(all_timezones)),
|
||||
)
|
||||
sql = fields.String(
|
||||
description=sql_description,
|
||||
example="SELECT value FROM time_series_table",
|
||||
metadata={
|
||||
"description": sql_description,
|
||||
"example": "SELECT value FROM time_series_table",
|
||||
},
|
||||
required=False,
|
||||
allow_none=True,
|
||||
)
|
||||
|
|
@ -259,13 +269,15 @@ class ReportSchedulePutSchema(Schema):
|
|||
ReportCreationMethod,
|
||||
by_value=True,
|
||||
allow_none=True,
|
||||
description=creation_method_description,
|
||||
metadata={"description": creation_method_description},
|
||||
)
|
||||
dashboard = fields.Integer(required=False, allow_none=True)
|
||||
database = fields.Integer(required=False)
|
||||
owners = fields.List(fields.Integer(description=owners_description), required=False)
|
||||
owners = fields.List(
|
||||
fields.Integer(metadata={"description": owners_description}), required=False
|
||||
)
|
||||
validator_type = fields.String(
|
||||
description=validator_type_description,
|
||||
metadata={"description": validator_type_description},
|
||||
validate=validate.OneOf(
|
||||
choices=tuple(key.value for key in ReportScheduleValidatorType)
|
||||
),
|
||||
|
|
@ -274,28 +286,25 @@ class ReportSchedulePutSchema(Schema):
|
|||
)
|
||||
validator_config_json = fields.Nested(ValidatorConfigJSONSchema, required=False)
|
||||
log_retention = fields.Integer(
|
||||
description=log_retention_description,
|
||||
example=90,
|
||||
metadata={"description": log_retention_description, "example": 90},
|
||||
required=False,
|
||||
validate=[Range(min=1, error=_("Value must be greater than 0"))],
|
||||
)
|
||||
grace_period = fields.Integer(
|
||||
description=grace_period_description,
|
||||
example=60 * 60 * 4,
|
||||
metadata={"description": grace_period_description, "example": 60 * 60 * 4},
|
||||
required=False,
|
||||
validate=[Range(min=1, error=_("Value must be greater than 0"))],
|
||||
)
|
||||
working_timeout = fields.Integer(
|
||||
description=working_timeout_description,
|
||||
example=60 * 60 * 1,
|
||||
metadata={"description": working_timeout_description, "example": 60 * 60 * 1},
|
||||
allow_none=True,
|
||||
required=False,
|
||||
validate=[Range(min=1, error=_("Value must be greater than 0"))],
|
||||
)
|
||||
recipients = fields.List(fields.Nested(ReportRecipientSchema), required=False)
|
||||
report_format = fields.String(
|
||||
default=ReportDataFormat.VISUALIZATION,
|
||||
dump_default=ReportDataFormat.VISUALIZATION,
|
||||
validate=validate.OneOf(choices=tuple(key.value for key in ReportDataFormat)),
|
||||
)
|
||||
extra = fields.Dict(default=None)
|
||||
force_screenshot = fields.Boolean(default=False)
|
||||
extra = fields.Dict(dump_default=None)
|
||||
force_screenshot = fields.Boolean(dump_default=False)
|
||||
|
|
|
|||
|
|
@ -26,12 +26,18 @@ sql_lab_get_results_schema = {
|
|||
|
||||
|
||||
class EstimateQueryCostSchema(Schema):
|
||||
database_id = fields.Integer(required=True, description="The database id")
|
||||
sql = fields.String(required=True, description="The SQL query to estimate")
|
||||
template_params = fields.Dict(
|
||||
keys=fields.String(), description="The SQL query template params"
|
||||
database_id = fields.Integer(
|
||||
required=True, metadata={"description": "The database id"}
|
||||
)
|
||||
sql = fields.String(
|
||||
required=True, metadata={"description": "The SQL query to estimate"}
|
||||
)
|
||||
template_params = fields.Dict(
|
||||
keys=fields.String(), metadata={"description": "The SQL query template params"}
|
||||
)
|
||||
schema = fields.String(
|
||||
allow_none=True, metadata={"description": "The database schema"}
|
||||
)
|
||||
schema = fields.String(allow_none=True, description="The database schema")
|
||||
|
||||
|
||||
class ExecutePayloadSchema(Schema):
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class TemporaryCachePostSchema(Schema):
|
|||
value = fields.String(
|
||||
required=True,
|
||||
allow_none=False,
|
||||
description="Any type of JSON supported text.",
|
||||
metadata={"description": "Any type of JSON supported text."},
|
||||
validate=validate_json,
|
||||
)
|
||||
|
||||
|
|
@ -32,6 +32,6 @@ class TemporaryCachePutSchema(Schema):
|
|||
value = fields.String(
|
||||
required=True,
|
||||
allow_none=False,
|
||||
description="Any type of JSON supported text.",
|
||||
metadata={"description": "Any type of JSON supported text."},
|
||||
validate=validate_json,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -57,22 +57,28 @@ get_related_schema = {
|
|||
|
||||
|
||||
class RelatedResultResponseSchema(Schema):
|
||||
value = fields.Integer(description="The related item identifier")
|
||||
text = fields.String(description="The related item string representation")
|
||||
extra = fields.Dict(description="The extra metadata for related item")
|
||||
value = fields.Integer(metadata={"description": "The related item identifier"})
|
||||
text = fields.String(
|
||||
metadata={"description": "The related item string representation"}
|
||||
)
|
||||
extra = fields.Dict(metadata={"description": "The extra metadata for related item"})
|
||||
|
||||
|
||||
class RelatedResponseSchema(Schema):
|
||||
count = fields.Integer(description="The total number of related values")
|
||||
count = fields.Integer(
|
||||
metadata={"description": "The total number of related values"}
|
||||
)
|
||||
result = fields.List(fields.Nested(RelatedResultResponseSchema))
|
||||
|
||||
|
||||
class DistinctResultResponseSchema(Schema):
|
||||
text = fields.String(description="The distinct item")
|
||||
text = fields.String(metadata={"description": "The distinct item"})
|
||||
|
||||
|
||||
class DistincResponseSchema(Schema):
|
||||
count = fields.Integer(description="The total number of distinct values")
|
||||
count = fields.Integer(
|
||||
metadata={"description": "The total number of distinct values"}
|
||||
)
|
||||
result = fields.List(fields.Nested(DistinctResultResponseSchema))
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class SamplesPayloadSchema(Schema):
|
|||
)
|
||||
extras = fields.Nested(
|
||||
ChartDataExtrasSchema,
|
||||
description="Extra parameters to add to the query.",
|
||||
metadata={"description": "Extra parameters to add to the query."},
|
||||
allow_none=True,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -28,18 +28,27 @@ get_recent_activity_schema = {
|
|||
|
||||
|
||||
class RecentActivitySchema(Schema):
|
||||
action = fields.String(description="Action taken describing type of activity")
|
||||
item_type = fields.String(description="Type of item, e.g. slice or dashboard")
|
||||
item_url = fields.String(description="URL to item")
|
||||
item_title = fields.String(description="Title of item")
|
||||
time = fields.Float(description="Time of activity, in epoch milliseconds")
|
||||
action = fields.String(
|
||||
metadata={"description": "Action taken describing type of activity"}
|
||||
)
|
||||
item_type = fields.String(
|
||||
metadata={"description": "Type of item, e.g. slice or dashboard"}
|
||||
)
|
||||
item_url = fields.String(metadata={"description": "URL to item"})
|
||||
item_title = fields.String(metadata={"description": "Title of item"})
|
||||
time = fields.Float(
|
||||
metadata={"description": "Time of activity, in epoch milliseconds"}
|
||||
)
|
||||
time_delta_humanized = fields.String(
|
||||
description="Human-readable description of how long ago activity took place"
|
||||
metadata={
|
||||
"description": "Human-readable description of how long ago activity took "
|
||||
"place."
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
class RecentActivityResponseSchema(Schema):
|
||||
result = fields.List(
|
||||
fields.Nested(RecentActivitySchema),
|
||||
description="A list of recent activity objects",
|
||||
metadata={"description": "A list of recent activity objects"},
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue