e-mission / op-admin-dashboard

An admin/deployer dashboard for the NREL OpenPATH platform
0 stars 9 forks source link

Fallback does not work: Data tables not visible if the dynamic config does not have `admin_dashboard` #46

Closed shankari closed 1 year ago

shankari commented 1 year ago

The dashboard is working fine on staging, but while checking production instances, we see zero trips.

Screenshot 2023-06-04 at 11 28 14 AM
shankari commented 1 year ago

This is 100% related to the configuration.

So the issue is definitely with the study config.

shankari commented 1 year ago

smart-commute-ebike STUDY_CONFIG doesn't have the public dashboard configured; stage does. If there is no admin dashboard configuration, we default to {}

permissions = config.get("admin_dashboard", {})

And by commenting in the print statements in `db_utils.py, we do have some data

DEBUG:root:After filtering, the actual data is                 data.start_fmt_time  ...  replaced_mode
0         2021-09-20T16:00:08-06:00  ...      no_travel
1  2021-09-20T16:30:32.960140-06:00  ...    drove_alone
2  2021-09-20T16:56:13.353779-06:00  ...    drove_alone
3  2021-09-20T17:19:25.349600-06:00  ...    drove_alone
4  2021-09-21T06:59:10.899343-06:00  ...           bike
DEBUG:root:After filtering, df columns are Index(['data.start_fmt_time', 'data.distance', 'data.start_loc.coordinates',
       'data.user_input.mode_confirm', 'data.user_input.purpose_confirm',
       'data.end_fmt_time', 'data.duration', 'user_id',
       'data.user_input.replaced_mode', 'data.end_loc.coordinates',
       'trip_start_time_str', 'trip_end_time_str', 'start_coordinates',
       'end_coordinates', 'mode_confirm', 'purpose_confirm', 'replaced_mode'],
      dtype='object')

Not sure why this is not showing up.

shankari commented 1 year ago

Quick check on whether this works for (say) denver-casr, which does have the admin dasboard currently configured.

That works. So this is indeed because the admin dashboard entry was not in the dynamic config. But why doesn't the workaround work? (permissions = config.get("admin_dashboard", {})) And where does the data get lost given that it apparently is read correctly in db_utils?

Screenshot 2023-06-04 at 3 40 14 PM