After deploying the dashboard, the demographics tab was not showing anything. When viewing the logs, (docker logs -f <container-id>), I found this error:
[2024-08-16 15:31:51,158] ERROR in app: Exception on /api/projects/KingCo/homeLocationsDemographics [GET]
Traceback (most recent call last):
File "/miniconda3/envs/trails-viz-api/lib/python3.7/site-packages/flask/app.py", line 2077, in wsgi_app
response = self.full_dispatch_request()
File "/miniconda3/envs/trails-viz-api/lib/python3.7/site-packages/flask/app.py", line 1525, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/miniconda3/envs/trails-viz-api/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/miniconda3/envs/trails-viz-api/lib/python3.7/site-packages/flask/app.py", line 1523, in full_dispatch_request
rv = self.dispatch_request()
File "/miniconda3/envs/trails-viz-api/lib/python3.7/site-packages/flask/app.py", line 1509, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/miniconda3/envs/trails-viz-api/lib/python3.7/site-packages/trailsvizapi/controller/home_locations.py", line 63, in get_project_home_locations_demographics
data = home_locations.get_project_demographic_summary(project)
File "/miniconda3/envs/trails-viz-api/lib/python3.7/site-packages/trailsvizapi/repository/home_locations.py", line 191, in get_project_demographic_summary
census_tract_states = app_config.CENSUS_TRACT_STATES[project]
KeyError: 'KingCo'
I determined that the trails-viz-api/trailsvizapi/config/app_config.py file needs to be updated:
Related to https://github.com/OutdoorRD/trails-viz-data/pull/60.
After deploying the dashboard, the
demographics
tab was not showing anything. When viewing the logs, (docker logs -f <container-id>
), I found this error:I determined that the
trails-viz-api/trailsvizapi/config/app_config.py
file needs to be updated:It should include
KingCo
. Unfortunately, this requires an entire re-build and re-deploy.