e-mission / op-admin-dashboard

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

[Bug Fix] Maps not visible on the staging admin dashboard #112

Closed jiji14 closed 4 months ago

jiji14 commented 4 months ago

[ Related Issue ] https://github.com/e-mission/op-admin-dashboard/issues/110

[ Overview ] Based on error log, the issue comes from KeyError: 'users_data_by_user_id', so I added error handling for this

Screenshot 2024-03-26 at 9 23 08 AM
shankari commented 4 months ago

@jiji14 it seems like "works" here means that there is no error. But there are also no trips. Are you sure that there are no trips in the database? What does the trip trends table show? If you select a different date range, does the map show up?

Concretely, on staging (which is where we first encountered this), I do see trips in the trips trend table. So why are is the users_data_by_user_id table not created correctly.

Screenshot 2024-03-26 at 11 53 09 AM
jiji14 commented 4 months ago

@shankari Thank you for your comment. Yes, I can see the trips in the database. Now I am investigating why the users_data_by_user_id table was not created correctly.

jiji14 commented 4 months ago

@shankari

There was a dataset where 'data.user_input.mode_confirm' did not exist in the column, causing the data to be missing on the map. I'm not sure if this case only exists in the development environment, but I labeled that trip as 'unlabeled' so it could show up on the map. When I shared the map page during the meeting, the trip data between 12/1/2023 and 12/2/2023 did not show up, but you can now see that it shows up as an unlabeled trip in screenshot.

Screenshot 2024-03-26 at 4 36 07 PM Screenshot 2024-03-26 at 4 36 19 PM

shankari commented 4 months ago

There was a dataset where 'data.user_input.mode_confirm' did not exist in the column, causing the data to be missing on the map.

Note that the admin dashboard does not work with static datasets, but instead, with the data that is coming in from the phones real-time. We sometimes work with snapshots of that real-time data, but this is not static analysis.

I'm not sure if this case only exists in the development environment, but I labeled that trip as 'unlabeled' so it could show up on the map.

If you are using a snapshot of real data, I am not sure why it would happen only in the development environment. This can happen any time none of the selected trips are labeled. For the snapshot you loaded, you can check the "Data" tab - and see if the mode_confirm is filled in. If it is not, this is clearly the problem.

shankari commented 4 months ago

I can verify that the current staging does not have any mode_confirm column because none of the trips were labeled. I suspect that this is the issue, and I am moving on to review this change now.

Screenshot 2024-03-26 at 5 43 10 PM
jiji14 commented 4 months ago

@shankari I thought we used dummy datasets for dev environment, not the real datasets. I got your point. Thanks for clarification. I also checked the "Data" tab doesn't not have mode_confirm column

Screenshot 2024-03-26 at 5 51 20 PM

shankari commented 4 months ago

@jiji14 I am squash-merging this to avoid the churn with the commits + reverts. Please make sure to account for that while starting your next PR!