flaski
flaski copied to clipboard
[BUG] cell plot saving not working
App cellplot
Describe the bug
Exception on /storage/_dash-update-component [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/dash/_callback.py", line 480, in add_context
jsonResponse = to_json(response)
File "/usr/local/lib/python3.10/site-packages/dash/_utils.py", line 22, in to_json
return to_json_plotly(value)
File "/usr/local/lib/python3.10/site-packages/plotly/io/_json.py", line 123, in to_json_plotly
return json.dumps(plotly_object, cls=PlotlyJSONEncoder, **opts)
File "/usr/local/lib/python3.10/json/__init__.py", line 238, in dumps
**kw).encode(obj)
File "/usr/local/lib/python3.10/site-packages/_plotly_utils/utils.py", line 59, in encode
encoded_o = super(PlotlyJSONEncoder, self).encode(o)
File "/usr/local/lib/python3.10/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/usr/local/lib/python3.10/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/usr/local/lib/python3.10/site-packages/_plotly_utils/utils.py", line 136, in default
return _json.JSONEncoder.default(self, obj)
File "/usr/local/lib/python3.10/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type DataFrame is not JSON serializable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1820, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/usr/local/lib/python3.10/site-packages/flask_login/utils.py", line 290, in decorated_view
return current_app.ensure_sync(func)(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/dash/dash.py", line 1273, in dispatch
ctx.run(
File "/usr/local/lib/python3.10/site-packages/dash/_callback.py", line 482, in add_context
_validate.fail_callback_output(output_value, output)
File "/usr/local/lib/python3.10/site-packages/dash/_validate.py", line 326, in fail_callback_output
_validate_value(val, index=i)
File "/usr/local/lib/python3.10/site-packages/dash/_validate.py", line 316, in _validate_value
_raise_invalid(
File "/usr/local/lib/python3.10/site-packages/dash/_validate.py", line 230, in _raise_invalid
raise exceptions.InvalidCallbackReturnValue(
dash.exceptions.InvalidCallbackReturnValue: The callback for `<Output `saveas.data`>`
returned a value having type `dict`
which is not JSON serializable.
The value in question is either the only value returned,
or is in the top level of the returned list,
and has string representation
`{'session_data': {'app': {'cellplot': {'filename': '2022_DAVID_analysis_RNA-Seq_xxxxx.xlsx', 'last_modified': 1670775098.612, 'df': '{"Category":{"0":"GOTERM_BP_FAT","1":"GOTERM_BP_FAT","2":"GOTERM_BP_FAT","3":"GOTER...