-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling the case where there are no query results #18
Comments
My proposal is that if there are no participants, the dashboard should just return an error for now. But if there are no trips, the easiest way, that I can think of right now, to solve this without running into a fatal error is to return a emptied data.table that has all the columns needed by the other functions. This is equivalent to subsetting a data.table with |
@asiripanich there will be participants because we register during onboarding. But there might not be trips or server calls corresponding to |
the commit looks good to me |
This still needs to be patched. |
I am now getting a new error with the dashboards for the new deployments
|
the key seems to be this error in
there are two users with 11 and 2 trips. So we get 13 trips correctly. Not quite sure why they are getting filtered out. |
so I loaded a bunch of other trips from two test users and the dashboard works fine now. I think that the problem might occur if there are no trips with labels. I have attached a mongodump that can be used to reproduce the problem and test the fix. |
@allenmichael099 is fixing this in #46. |
If there are no query results, then many functions break. For the most recent change (#17), these were:
A workaround is to add the following short-circuit code to the beginning of each function.
The query results can return no values early in the data collection; when there have been no trips yet, for example, or the user has not synced with the server yet.
I am not an R expert, so was curious about how you plan to handle the case in which there are no query results. Instead of adding short-circuit code to each function, is there a way to create a blank data table at the query level?
The text was updated successfully, but these errors were encountered: