You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/10/27 05:41:25 UTC

[GitHub] [superset] villebro commented on a change in pull request #17234: fix(annotations): handle required fields properly

villebro commented on a change in pull request #17234:
URL: https://github.com/apache/superset/pull/17234#discussion_r737122275



##########
File path: superset/annotation_layers/annotations/schemas.py
##########
@@ -57,11 +57,18 @@ def validate_json(value: Union[bytes, bytearray, str]) -> None:
 
 class AnnotationPostSchema(Schema):
     short_descr = fields.String(
-        description=annotation_short_descr, allow_none=False, validate=[Length(1, 500)]
+        description=annotation_short_descr,
+        required=True,
+        allow_none=False,

Review comment:
       `required=True` only makes sure the property is defined, so here we need to also add `allow_none=False` to make sure `null` values aren't accepted.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org