I’ve a dashboard and i generate the plots when user access the dashboard for the first time and cache the object . Now next when when user comes back with same url i want to return the cached object but getting following error :
Returning from cache defaultdict(<class 'dict'>, {'666b5bf7-8f1a-46d4-96d5-3e510108fd6c_Diag_aligned_data_json_Temp': {'BLER': Panel(id='2573', ...)}})
Done Processing ...
bokeh.application.application - ERROR - Error running application handler <bokeh.application.handlers.directory.DirectoryHandler object at 0x7f85ae18a990>: Models must be owned by only a single document, Line(id='2385', ...) is already in a doc
File "model.py", line 671, in _attach_document:
raise RuntimeError("Models must be owned by only a single document, %r is already in a doc" % (self)) Traceback (most recent call last):
File "/home/hadoop/miniconda/lib/python3.7/site-packages/bokeh/application/handlers/code_runner.py", line 197, in run
exec(self._code, module.__dict__)
File "/home/hadoop/bokeh_app/main.py", line 15, in <module>
dashboard(doc, getClient(), job_id=job_id)
File "/home/hadoop/bokeh_app/scripts/dashboard.py", line 286, in dashboard
doc.add_root(column(theme_select, adv_tabs))
File "/home/hadoop/miniconda/lib/python3.7/site-packages/bokeh/document/document.py", line 319, in add_root
self._pop_all_models_freeze()
File "/home/hadoop/miniconda/lib/python3.7/site-packages/bokeh/document/document.py", line 1056, in _pop_all_models_freeze
self._recompute_all_models()
File "/home/hadoop/miniconda/lib/python3.7/site-packages/bokeh/document/document.py", line 1079, in _recompute_all_models
a._attach_document(self)
File "/home/hadoop/miniconda/lib/python3.7/site-packages/bokeh/model.py", line 671, in _attach_document
raise RuntimeError("Models must be owned by only a single document, %r is already in a doc" % (self))
RuntimeError: Models must be owned by only a single document, Line(id='2385', ...) is already in a doc
any suggestions ?