UBC-MDS / Mental-Health-in-Tech-Dashboard

The Mental Health in Tech Dashboard visualizes a dataset consisting of survey questions and responses about various aspects of the mental health of tech workers.
https://mentalhealth-in-tech.herokuapp.com/
MIT License
4 stars 3 forks source link

Callback error - main branch #39

Closed d-sel closed 3 years ago

d-sel commented 3 years ago

I'm encountering errors when I click on Section-2 tab. Can others please see if they can reproduce the error and, if so, can you please check latest pushes to main?


Traceback (most recent call last)
File "/Users/selma/UBC_MDS_Coursework/Block_4/DSCI_532_Visualization_2/group-19/src/app.py", line 185, in mental_health_benefits_employer_donut_chart
return build_graph(column_name, mental_health_benefits_employer)
File "/Users/selma/UBC_MDS_Coursework/Block_4/DSCI_532_Visualization_2/group-19/src/app.py", line 204, in build_graph
fig = go.Figure(data=[go.Pie(labels=labels, values=values, hole=.44)])
File "/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/graph_objs/_pie.py", line 2090, in __init__
self["hole"] = _v
File "/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/basedatatypes.py", line 4792, in __setitem__
validator = self._get_validator(prop)
File "/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/basedatatypes.py", line 4272, in _get_validator
from .validator_cache import ValidatorCache
ImportError: cannot import name 'ValidatorCache' from partially initialized module 'plotly.validator_cache' (most likely due to a circular import) (/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/validator_cache.py)
Traceback (most recent call last):
  File "/Users/selma/UBC_MDS_Coursework/Block_4/DSCI_532_Visualization_2/group-19/src/app.py", line 185, in mental_health_benefits_employer_donut_chart
    return build_graph(column_name, mental_health_benefits_employer)
  File "/Users/selma/UBC_MDS_Coursework/Block_4/DSCI_532_Visualization_2/group-19/src/app.py", line 204, in build_graph
    fig = go.Figure(data=[go.Pie(labels=labels, values=values, hole=.44)])
  File "/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/graph_objs/_pie.py", line 2090, in __init__
    self["hole"] = _v
  File "/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/basedatatypes.py", line 4792, in __setitem__
    validator = self._get_validator(prop)
  File "/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/basedatatypes.py", line 4272, in _get_validator
    from .validator_cache import ValidatorCache
ImportError: cannot import name 'ValidatorCache' from partially initialized module 'plotly.validator_cache' (most likely due to a circular import) (/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/validator_cache.py)```

Callback error updating mental_health_leave_donutplot.figure
ImportError: cannot import name 'ValidatorCache' from partially initialized module 'plotly.validator_cache' (most likely due to a circular import) (/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/validator_cache.py)

Traceback (most recent call last)
File "/Users/selma/UBC_MDS_Coursework/Block_4/DSCI_532_Visualization_2/group-19/src/app.py", line 192, in mental_health_leave_donut_chart
return build_graph(column_name, mental_health_leave)
File "/Users/selma/UBC_MDS_Coursework/Block_4/DSCI_532_Visualization_2/group-19/src/app.py", line 204, in build_graph
fig = go.Figure(data=[go.Pie(labels=labels, values=values, hole=.44)])
File "/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/graph_objs/_pie.py", line 2090, in __init__
self["hole"] = _v
File "/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/basedatatypes.py", line 4792, in __setitem__
validator = self._get_validator(prop)
File "/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/basedatatypes.py", line 4272, in _get_validator
from .validator_cache import ValidatorCache
ImportError: cannot import name 'ValidatorCache' from partially initialized module 'plotly.validator_cache' (most likely due to a circular import) (/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/validator_cache.py)
Traceback (most recent call last):
  File "/Users/selma/UBC_MDS_Coursework/Block_4/DSCI_532_Visualization_2/group-19/src/app.py", line 192, in mental_health_leave_donut_chart
    return build_graph(column_name, mental_health_leave)
  File "/Users/selma/UBC_MDS_Coursework/Block_4/DSCI_532_Visualization_2/group-19/src/app.py", line 204, in build_graph
    fig = go.Figure(data=[go.Pie(labels=labels, values=values, hole=.44)])
  File "/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/graph_objs/_pie.py", line 2090, in __init__
    self["hole"] = _v
  File "/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/basedatatypes.py", line 4792, in __setitem__
    validator = self._get_validator(prop)
  File "/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/basedatatypes.py", line 4272, in _get_validator
    from .validator_cache import ValidatorCache
ImportError: cannot import name 'ValidatorCache' from partially initialized module 'plotly.validator_cache' (most likely due to a circular import) (/opt/miniconda3/envs/532/lib/python3.9/site-packages/plotly/validator_cache.py)
chiragrank commented 3 years ago

That's Interesting! I assume this error is without making any changes to the main if not please correct me. I re-ran from the main branch but am not able to reproduce the error on my laptop. Maybe others can have a look and see as well to check.

d-sel commented 3 years ago

Yes, this is from main without any changes.

chiragrank commented 3 years ago

Thanks for confirming that. Maybe @mikelynch416 and @fatse can have a look to see if they are able to reproduce the error so that we can investigate further

mikelynch416 commented 3 years ago

Yeah I'm seeing the same error as well now that I click on the third tab. My bad for merging the pr without noticing that error

Edit: While trying to figure out the cause I restarted it locally and the error is not appearing for me anymore?? Also it doesn't seem to happen on Heroku

chiragrank commented 3 years ago

@d-sel Does restarting solve the issue for you?

d-sel commented 3 years ago

By restarting, you mean stopping the server and running again? If so, no, it does not solve the issue.

I am running it locally (not on Heroku).

chiragrank commented 3 years ago

Yes, I meant starting it locally again.

d-sel commented 3 years ago

Intermediate fix: refresh browser window will stop the error from showing up. However, if restarting the app locally, will prompt the error again.

Will see if this shows up in Heroku. Otherwise, can leave for later as doesn't impact functioning of app.

fatse commented 3 years ago

We can close this Issue as you @d-sel and @chiragrank brought this up to the instructor and the cause of this issue still remains unclear and unhandled. As Joel suggested, it's probably a machine-related bug.