Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeing "sanity check fails for dataframe in SJOG prod data #2472

Open
id2359 opened this issue May 15, 2023 · 2 comments
Open

Seeing "sanity check fails for dataframe in SJOG prod data #2472

id2359 opened this issue May 15, 2023 · 2 comments

Comments

@id2359
Copy link
Member

id2359 commented May 15, 2023

[ERROR:2023-05-15 14:46:06,946:log.py:224:log_response] Internal Server Error: /crcmi/dash/app/SinglePatientDashboardApp/_dash-update-component
Traceback (most recent call last):
File "/env/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/env/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/env/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/env/lib/python3.8/site-packages/django_plotly_dash/views.py", line 74, in update
return _update(request, ident, stateless, **kwargs)
File "/env/lib/python3.8/site-packages/django_plotly_dash/views.py", line 91, in _update
resp = app.dispatch_with_args(request_body, arg_map)
File "/env/lib/python3.8/site-packages/django_plotly_dash/dash_wrapper.py", line 700, in dispatch_with_args
res = callback(*args, **argMap)
File "/env/lib/python3.8/site-packages/django_plotly_dash/callback.py", line 82, in add_context
output_value = func(*func_args, **func_kwargs) # %% callback invoked %%
File "/env/lib/python3.8/site-packages/dashboards/dash_apps.py", line 87, in render_tab_content
graphics_map = get_single_patient_graphics_map(
File "/env/lib/python3.8/site-packages/dashboards/utils.py", line 230, in get_single_patient_graphics_map
graphics_map = {
File "/env/lib/python3.8/site-packages/dashboards/utils.py", line 231, in
f"tab
{vc.id}": create_graphic(vc, data, patient, None, static_followups)
File "/env/lib/python3.8/site-packages/dashboards/utils.py", line 138, in wrapper
return func(vis_config, data, patient, all_patients_data, static_followups)
File "/env/lib/python3.8/site-packages/dashboards/utils.py", line 175, in create_graphic
return ScaleGroupComparison(
File "/env/lib/python3.8/site-packages/dashboards/components/common.py", line 58, in graphic
return self.get_graphic()
File "/env/lib/python3.8/site-packages/dashboards/components/sgc.py", line 95, in get_graphic
self.load_all_patients_data()
File "/env/lib/python3.8/site-packages/dashboards/components/sgc.py", line 524, in load_all_patients_data
sanity_check("in load all", self.all_patients_data)
File "/env/lib/python3.8/site-packages/dashboards/utils.py", line 284, in sanity_check
raise DataFrameError(
dashboards.utils.DataFrameError: in load all followup should have seq > 0: FollowUpProms has seq = 0
[INFO:2023-05-15 14:46:26,135:dash_apps.py:71:render_tab_content] active tab tab_9
[INFO:2023-05-15 14:46:26,467:data.py:103:init] time taken to load/generate df = 0.024986 seconds
[INFO:2023-05-15 14:46:27,023:data.py:88:init] loading dataframe from base config json
[INFO:2023-05-15 14:46:27,190:dash_apps.py:132:] all_app defined
[INFO:2023-05-15 14:46:27,395:data.py:103:init] time taken to load/generate df = 0.372242 seconds
[ERROR:2023-05-15 14:46:27,737:log.py:224:log_response] Internal Server Error: /crcmi/dash/app/SinglePatientDashboardApp/_dash-update-component
Traceback (most recent call last):
File "/env/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/env/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/env/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/env/lib/python3.8/site-packages/django_plotly_dash/views.py", line 74, in update
return _update(request, ident, stateless, **kwargs)
File "/env/lib/python3.8/site-packages/django_plotly_dash/views.py", line 91, in _update
resp = app.dispatch_with_args(request_body, arg_map)
File "/env/lib/python3.8/site-packages/django_plotly_dash/dash_wrapper.py", line 700, in dispatch_with_args
res = callback(*args, **argMap)
File "/env/lib/python3.8/site-packages/django_plotly_dash/callback.py", line 82, in add_context
output_value = func(*func_args, **func_kwargs) # %% callback invoked %%
File "/env/lib/python3.8/site-packages/dashboards/dash_apps.py", line 87, in render_tab_content
graphics_map = get_single_patient_graphics_map(
File "/env/lib/python3.8/site-packages/dashboards/utils.py", line 230, in get_single_patient_graphics_map
graphics_map = {
File "/env/lib/python3.8/site-packages/dashboards/utils.py", line 231, in
f"tab
{vc.id}": create_graphic(vc, data, patient, None, static_followups)
File "/env/lib/python3.8/site-packages/dashboards/utils.py", line 138, in wrapper
return func(vis_config, data, patient, all_patients_data, static_followups)
File "/env/lib/python3.8/site-packages/dashboards/utils.py", line 175, in create_graphic
return ScaleGroupComparison(
File "/env/lib/python3.8/site-packages/dashboards/components/common.py", line 58, in graphic
return self.get_graphic()
File "/env/lib/python3.8/site-packages/dashboards/components/sgc.py", line 95, in get_graphic
self.load_all_patients_data()
File "/env/lib/python3.8/site-packages/dashboards/components/sgc.py", line 524, in load_all_patients_data
sanity_check("in load all", self.all_patients_data)
File "/env/lib/python3.8/site-packages/dashboards/utils.py", line 284, in sanity_check
raise DataFrameError(

@id2359
Copy link
Member Author

id2359 commented May 15, 2023

This is caused when a followup doesn't have a collection date or is before or equal to the collection date of the baseline ( for any patient) - it screws up everyones dashboard as the sanity check occurs on each sgc component

@id2359
Copy link
Member Author

id2359 commented May 15, 2023

better to make it less brittle or enforce the collection date policy - on SjOG prod the collection date field was introduced after some followups collected and the dates are empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant