-
Notifications
You must be signed in to change notification settings - Fork 10
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
fix calendar generating start_date > end_date #78
Conversation
Thank you for taking the time to write a patch. I don't have the latest data to hand - do you know why the end date before the start date? Given it's on the associated schedule (W27693_W28273) and not the cloned journeys I think the suspect logic would be:
I can't remember why we would use the calendar from the assoc train service ( Does changing that code in |
The original clone function accidentally mutates the parameters passed in (hence I have added two lines of After I added the two lines of The following is the raw data:
and the CSV exported from the database
|
Thanks, I'm just wondering if it's possible to prevent the null returns in order to simplify the code |
Matching up the associations and services with the overlays makes it look like the start date for W28273 is wrong:
At that point the min/max should kick in and the max of the start date should use the AA record start date and the start and end should come out as 231124. That would suggest the merged record is fine but then we will create another service for before the association:
I regret the naming of The new before service should run from Sorry for thinking out loud. I haven't touched this code in years and the "correct" behaviour is not always obvious. |
@miklcct I think they have corrected the data this morning so that the runs_from field for:
Now matches the association record. I'm inclined to merge the fix for the mutation bug you found but not the changes that allow null schedules. |
If I only fix the mutation bug it generates a GTFS with a few calendar ranges between Christmas and New Year with start_date being 1 day after the end_date, so I believe returning null from |
I did a quick check with today's data and I couldn't find any cases where the start date was after the end date. What records are you seeing? |
I have just run the generator on the latest Errors are generated as follows: The full report can be viewed here. |
Ah it looks like your on the weekly feed. I'm on the daily which is 932 |
Try processing these after the 930 |
Error still exist on version 932: filename (?)The name of the faulty file. csvRowNumber (?)The row number of the faulty record. entityId (?)The faulty service id. startFieldName (?)The start value's field name. startValue (?)The start value. endFieldName (?)The end value's field name. endValue (?)The end value. |
I get a completely different set of data |
This is my 930: https://file.io/yK4ODhtZDv6b - is it the same as yours? |
Yes the files are the same. Have you added the two lines of |
No, just running from master. I'll try again with the clone methods |
That's so weird! Adding the clones, which I would expect to be fine then gives me the same results as you. I'll debug a bit further. Sorry this is taking so long. |
An upstream bug causing pipeline failures [PR submitted to upstream](planarnetwork#78) Related work items: #951
This prevents any calendar entries with start_date > end_date from leaking out by preventing them from being returned at the first instance.
fixes #76