dpgaspar commented on a change in pull request #9724:
URL: 
https://github.com/apache/incubator-superset/pull/9724#discussion_r419552769



##########
File path: superset/charts/schemas.py
##########
@@ -38,35 +95,74 @@ def validate_json(value: Union[bytes, bytearray, str]) -> 
None:
 
 
 class ChartPostSchema(Schema):
-    slice_name = fields.String(required=True, validate=Length(1, 250))
-    description = fields.String(allow_none=True)
-    viz_type = fields.String(allow_none=True, validate=Length(0, 250))
-    owners = fields.List(fields.Integer())
-    params = fields.String(allow_none=True, validate=validate_json)
-    cache_timeout = fields.Integer(allow_none=True)
-    datasource_id = fields.Integer(required=True)
-    datasource_type = fields.String(required=True)
-    datasource_name = fields.String(allow_none=True)
-    dashboards = fields.List(fields.Integer())
+    """
+    Schema to add a new chart.
+    """
+
+    slice_name = fields.String(
+        description=slice_name_description, required=True, validate=Length(1, 
250)
+    )
+    description = fields.String(description=description_description, 
allow_none=True)

Review comment:
       There are some slight differences, my understanding is that `required`, 
requires that a field is present, but the field can be present but the value is 
`null` for example
   




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to