betodealmeida edited a comment on pull request #15151:
URL: https://github.com/apache/superset/pull/15151#issuecomment-860861291


   > @betodealmeida the best way of doing that, that comes to mind for me, is 
to add in a validation test w/ a string in the api_tests? Should also check 
with a port that is outside the range.
   
   Right, add a test to `tests/databases/api_tests` passing a string as the 
port. 
   
   The backend currently doesn't validate the port range, you can add that by 
passing a [`range` 
validator](https://marshmallow.readthedocs.io/en/stable/marshmallow.validate.html#marshmallow.validate.Range):
   
   ```python
   from marshmallow import validate
   port = fields.Integer(required=True, description=__("Database port"), 
validate=validate.Range(1, 2**16-1) 
   ```


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