predictions with null arrival and departure times

108 views
Skip to first unread message

John Callerame

unread,
Jul 23, 2020, 5:57:58 PM7/23/20
to MBTA Developers
Hello,

I am seeing a lot of records returned by the predictions service containing null for both arrival_time and departure_time.  I'm seeing this especially with the commuter rail, but I also saw it with silver line bus SL2.  It may occur with other routes too, I'm not sure.  In any case, what does this mean?  In some cases, I see "schedule_relationship: "SKIPPED", which may be an explanation of sorts.  But in other cases, I see "schedule_relationship: null", just like with most predictions.  Why are these records with null arrival and departure times being returned by the predictions service?


{"attributes":{"arrival_time":null,"departure_time":null,"direction_id":0,"schedule_relationship":null,"status":"On time","stop_sequence":1},"id":"prediction-CR-Weekday-Summer-20-7525-South Station-1","relationships":{"route":{"data":{"id":"CR-Worcester","type":"route"}},"stop":{"data":{"id":"South Station","type":"stop"}},"trip":{"data":{"id":"CR-Weekday-Summer-20-7525","type":"trip"}},"vehicle":{"data":null}},"type":"prediction"}

Thanks,

John Callerame

Developer at MBTA

unread,
Jul 28, 2020, 5:42:21 PM7/28/20
to MBTA Developers
Hi John, thanks for reporting this!

It is intentional that SKIPPED predictions have null arrival and departure times, since in general the departure_time is null if riders can't board the vehicle at the stop, and the arrival_time is null if riders can't exit the vehicle at the stop. If a scheduled stop is skipped, these are both true. (see the field documentation under PredictionResource in our Swagger docs for info on the different schedule_relationship values)

For Commuter Rail departures, we can reproduce the issue where predictions have a null schedule_relationship, departure_time, and arrival_time. This looks like it might be a regression — we will investigate and provide an update when we know more. To clarify, have you seen this issue with the SL2, or were those SKIPPED predictions?

John Callerame

unread,
Jul 28, 2020, 6:26:42 PM7/28/20
to MBTA Developers
hmmm... I don't remember, and I'm not seeing it now... if I see it again for non-skipped predictions outside of the commuter rail, I'll let you know.

John

John Callerame

unread,
Aug 14, 2020, 6:31:23 PM8/14/20
to MBTA Developers
Any progress on this?  I'm still not seeing many commuter rail predictions with actual arrival or departure times.

John

Developer at MBTA

unread,
Aug 17, 2020, 11:28:29 AM8/17/20
to MBTA Developers
Hi John, we have confirmed this is a regression that occurred some time ago. Unfortunately the fix is complicated, due to how it will interact with other systems, so it's unlikely this will be addressed before September. We can't remove these predictions from the feed entirely, because they also provide live boarding information (e.g. track assignments, the `status` field) that would not otherwise be available anywhere else.

Our recommended workarounds for now:
  • If you don't need boarding information, you can completely ignore these "null/null/null" predictions, as they aren't giving you any information beyond the static schedule data.
  • If you do need the boarding information, your app will need to handle the case where this info is present but there is no predicted departure time. If this is a rider-facing app, you would have to either indicate that the departure time is unknown, or fall back on the scheduled departure time with a clear indicator that this is happening (i.e. that despite the boarding status being "live", the departure time is not).

john.ca...@gmail.com

unread,
Aug 20, 2020, 1:59:16 PM8/20/20
to MBTA Developers
ok... thanks for the update.

John
Reply all
Reply to author
Forward
0 new messages