Closed achasmita closed 10 months ago
I am not able to make filter by date range yet , i will try it in morning again.
@achasmita I think that the code to filter by date range is fairly simple - you should be able to copy it from the trip code https://github.com/e-mission/op-admin-dashboard/blob/35fc91dd245e65f086b2a9af4f6a4711cfaec659/utils/db_utils.py#L51
Let's try to get it in before merging because people may want to filter by a date range given how slow the data load is.
I am using the same code, and as table is loaded only when tab is selected, I am still figuring out on making both thing works.
Is it ok if we load a recent week data at first and then allow user to load data based on the date range they select. Instead of loading data only when trajectory table is selected ?
@achasmita are you proposing to roll in the scalability fixes (https://github.com/e-mission/op-admin-dashboard/issues/51)? I have no objections to that approach, but would like to understand why it is needed.
As I said before, please record what you tried in the issue and how it failed "The goal is not just to get things to work, but to get them to work right". https://github.com/e-mission/op-admin-dashboard/issues/70#issuecomment-1740268393
@achasmita it will also give me a sense of how complicated the problem is, and whether we should go ahead with pushing this change
@achasmita are you proposing to roll in the scalability fixes (#51)? I have no objections to that approach, but would like to understand why it is needed.
As I said before, please record what you tried in the issue and how it failed "The goal is not just to get things to work, but to get them to work right". #70 (comment)
Yes it will work for both. I tried to pass the date range to filter trajectory table but the table was not loading as expected. It was loading all data everytime. I saw the date range change when i select different date range #72 but the data remains same.
@achasmita are you proposing to roll in the scalability fixes (#51)? I have no objections to that approach, but would like to understand why it is needed.
As I said before, please record what you tried in the issue and how it failed "The goal is not just to get things to work, but to get them to work right". #70 (comment)
Yes it will work for both. I tried to filter the trajectory table in previous code by date range but there was no change in data even after filter is provided. Everytime all the data is loadaed in table so last time I filed the issue.
Ok I figured it out, I was doing sth wrong while passing the date, now it works both the way either we can load trajectory tab when respective tab is selected and apply filter range or we can load data for current week and use date range to load data as needed.
Testing is done and table is loading fine now.
![Screen Shot 2023-09-29 at 12 26 49 AM](https://github.com/e-mission/op-admin-dashboard/assets/79387860/2ffbf682-64ba-4755-b685-99c64bbdd872)