swecooo opened a new issue #11929:
URL: https://github.com/apache/incubator-superset/issues/11929


   I'm unable to download a screenshot using the Chart REST API screenshot 
endpoint. When I call the `/charts/<pk>/screenshot/<digest>` endpoint, I get 
`{"message": "Fatal error"}` response. In the logs, I can see the following 
error:
   
   ```
   ERROR:root:screenshot() got an unexpected keyword argument 'rison'
   --
   Traceback (most recent call last):
   File 
"/usr/local/lib/python3.7/site-packages/flask_appbuilder/api/__init__.py", line 
84, in wraps
   return f(self, *args, **kwargs)
   File "/usr/local/lib/python3.7/site-packages/superset/views/base_api.py", 
line 50, in wraps
   duration, response = time_function(f, self, *args, **kwargs)
   File "/usr/local/lib/python3.7/site-packages/superset/utils/core.py", line 
1282, in time_function
   response = func(*args, **kwargs)
   TypeError: screenshot() got an unexpected keyword argument 'rison'
   ```
   
   I've never worked with `rison` but from the 
[documentation](https://flask-appbuilder.readthedocs.io/en/latest/api.html?highlight=%40rison#flask_appbuilder.api.rison),
 it seems that it adds a keyword argument `rison` with the parameters.
   
   The traceback along with the documentation suggest that `screenshot` method 
might be missing `**kwargs` in [its 
signature](https://github.com/apache/incubator-superset/blob/master/superset/charts/api.py#L614).
   
   ### Expected results
   
   The screenshot being returned.
   
   ### Actual results
   
   The REST API returns `{"message": "Fatal error"}`
   
   #### How to reproduce the bug
   
   1. Call `cache_screenshot` on one of your charts: 
`https://my-superset.com/api/v1/charts/1/cache_screenshot`
   2. Open the `image_url` link from the response of the previous request: 
`https://my-superset.com/api/v1/charts/1/screenshot/<digest>`
   3. Observe response `{"message": "Fatal error"}`
   
   ### Environment
   
   - superset version: `0.37.2`
   - python version: `3.7.9`
   - node.js version: `v12.20.0`
   
   ### Checklist
   
   - [x] I have checked the superset logs for python stacktraces and included 
it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version 
of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't 
found one similar.


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