villebro commented on code in PR #23655:
URL: https://github.com/apache/superset/pull/23655#discussion_r1169597164
##########
superset/datasets/schemas.py:
##########
@@ -145,6 +146,34 @@ class DatasetRelatedObjectsResponse(Schema):
dashboards = fields.Nested(DatasetRelatedDashboards)
+class DatasetResponse(Schema):
+ id = fields.Int()
+ cache_timeout = fields.Int()
+ columns = fields.List(fields.Dict())
Review Comment:
Setting this as `fields.List(fields.Dict())` causes it to lose the datatype.
This is after this change:
<img width="922" alt="image"
src="https://user-images.githubusercontent.com/33317356/232698854-769e8dc0-a3f8-4fd5-bbc9-322cf2f94ced.png">
This is before the change:
<img width="919" alt="image"
src="https://user-images.githubusercontent.com/33317356/232699232-dbaab196-9936-4196-921c-da0200eed33b.png">
Here's a schema that I believe is more complete that could probably serve as
a better template:
https://github.com/apache/superset/blob/c197bf9e6db85a76d8118a4ec11a83ca2f6aad6d/superset/datasets/schemas.py#L47-L63
##########
superset/datasets/schemas.py:
##########
@@ -145,6 +146,34 @@ class DatasetRelatedObjectsResponse(Schema):
dashboards = fields.Nested(DatasetRelatedDashboards)
+class DatasetResponse(Schema):
+ id = fields.Int()
+ cache_timeout = fields.Int()
+ columns = fields.List(fields.Dict())
+ database = fields.Nested(DatabaseSchema)
+ datasource_type = fields.String()
+ default_endpoint = fields.String()
+ description = fields.String()
+ extra = fields.String()
+ fetch_values_predicate = fields.String()
+ filter_select_enabled = fields.Bool()
+ is_managed_externally = fields.Bool()
+ is_sqllab_view = fields.Bool()
+ kind = fields.String()
+ main_dttm_col = fields.String()
+ metrics = fields.List(fields.Dict())
Review Comment:
same here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]