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 2022/07/26 17:19:37 UTC

[GitHub] [superset] EugeneTorap opened a new issue, #20873: Validate request fields of sql_json API

EugeneTorap opened a new issue, #20873:
URL: https://github.com/apache/superset/issues/20873

   We use postman/insomnia http client to call/test all superset API.
   And we found that `/superset/sql_json/` API don't validate required fields. For example if we don't provide `sql` field in JSON body of request we get such error: `"message": "Failed to execute query '164' - 'None': 'NoneType' object has no attribute 'strip'"` and create a record with column is `null` for Query History (db table - `query`)
   
   #### How to reproduce the bug
   
   1. Call `login` API to auth
   2. Call `/superset/sql_json/` API with `sql` field
   3. See response error
   4. See error for `/api/v1/query/` API
   
   ### Expected results
   
   We have to validate required fields for `/superset/sql_json/` API .
   
   ### Actual results
   
   There's no validation for `/superset/sql_json/` API .
   Columns sql has null value in db table - `query`.
   `/api/v1/query/` API is broken with error message is `"error": "'NoneType' object has no attribute 'strip'"`
   
   #### Screenshots
   
   ![image](https://user-images.githubusercontent.com/29536522/181068957-91e9ce3a-0c2c-4bbf-8a95-2a93ff5a8bf4.png)
   ![image](https://user-images.githubusercontent.com/29536522/181069075-f15a44b9-40c9-46c7-bac7-654ec1d64dd7.png)
   ![image](https://user-images.githubusercontent.com/29536522/181069158-dec7b7ee-307c-4a81-b70d-14afb2e4239d.png)
   
   
   ### Environment
   
   (please complete the following information):
   
   - browser type and version:
   - superset version: `superset version`
   - python version: `python --version`
   - node.js version: `node -v`
   - any feature flags active:
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [ ] I have reproduced the issue with at least the latest released version of superset.
   - [ ] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   
   Add any other context about the problem here.
   @michael-s-molina @kgabryje @codyml @zhaoyongjie @diegomedina248 @jinghua-qa @geido @AAfghahi @srinify 


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


[GitHub] [superset] zhaoyongjie closed issue #20873: Validate request fields in sql_json API

Posted by GitBox <gi...@apache.org>.
zhaoyongjie closed issue #20873: Validate request fields in sql_json API
URL: https://github.com/apache/superset/issues/20873


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