Closed jiji14 closed 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.
@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.
@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.
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.
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.
@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
@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!
[ 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