-
Notifications
You must be signed in to change notification settings - Fork 18
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: 500 when getting vehicle with OL crowding data #663
Conversation
Coverage of commit
|
Coverage of commit
|
defp encode_carriage(carraige) do | ||
%{ | ||
label: carraige.label, | ||
carriage_sequence: carraige.carriage_sequence, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question:
- if the order is already present given that this is an ordered list, does the
carriage_sequence
need to be included? - and if it does need to be included, couldn't the key be
sequence
since the item is already known to be a carriage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally I wouldn't want to change the API contact in a bugfix, but I suppose this is a bit of a special case, since this information wasn't available before, and wouldn't have worked if it was, so there shouldn't be any downstream consumers depending on the shape.
For my 2c, I'd probably leave carriage_sequence
out entirely, since it's implied by the array and the API breaks from the GTFS spec in other ways (such as putting these on the carriage
field). That said these fields to map directly to the corresponding GTFS fields, and carriage_sequence
is actually the only field required in the spec. For context it looks like this was originally implemented in this ticket that calls for those fields.
I'll defer to you on the final shape. If you want it dropped it's easy enough to do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming that there's some other part of the system (maybe the consist/carriage parsing?) that's ensuring the list is in carriage_sequence
order, I'd prefer to drop it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The GTFS spec requires they be in order, and RTR is generating the sequence numbers based on their position in the array so we should be covered there. The field has been removed.
Coverage of commit
|
Coverage of commit
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍰 should we put this up on dev-green for more testing before merging?
The initial version has been in dev-green for the last couple days. I've gone ahead and sent the new version. I don't think there's any particular rush for this to go out, just needs to happen before the RTR crowding changes land. |
16de1b4
to
b3cf3db
Compare
Coverage of commit
|
Summary of changes
Asana Ticket: 👥🔮 Surface car-level crowding data through RTR
This fixes the 500 error when attempting to encode vehicles with carriages. It also adds carriages to the tests, and adds the remaining legal occupancy statuses.