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: [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]

Reply via email to