Skip to content
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: Filter out predictions w/ arrival_time but no departure_time. #2211

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cmaddox5
Copy link
Contributor

@cmaddox5 cmaddox5 commented Sep 18, 2024

This PR adds additional filtering to predictions returned from the API. When a prediction has an arrival_time but no departure_time, it is an API best practice to filter it out.


@cmaddox5 cmaddox5 requested a review from a team as a code owner September 18, 2024 18:15
@@ -58,6 +59,12 @@ defmodule Screens.V2.Departure.Builder do

defp vehicle_already_departed?(_), do: false

defp prediction_has_no_departure_time?(%Schedule{}), do: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also do this for scheduled departures, I think (filtering them out if they have no departure time). We don't want to display an "arrival-only" stop that won't be accepting passengers, even if it's not a live prediction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants