cal-itp / data-infra

Cal-ITP data infrastructure
https://docs.calitp.org/data-infra
GNU Affero General Public License v3.0
48 stars 13 forks source link

Enhancement: Improve trip schedule relationship handling in `all_tu_in_vp` guideline check #2776

Open lauriemerrell opened 1 year ago

lauriemerrell commented 1 year ago

Currently this is implemented with a check for stops with scheduled/canceled/added schedule relationships. There is a TODO comment in the code: TODO: you can have a trip-level schedule relationship of scheduled, canceled, or added without having stop-level updates of those types -- we would need a trip level schedule_relationship on fct_observed_trips to make this more robust. As of #2489, we will have this trip-level schedule relationship data in fct_observed_trips.

As a result, we want to change this check to perform the check when either the trip level OR any stop level relationship is present.

We also want to reconsider the handling of canceled trips here. It seems odd that a canceled trip would have vehicle positions data; vehicle positions is generally only for trips that are actually happening. We want to check whether we should instead confirm that for canceled trips there is no vehicle positions data.

lauriemerrell commented 1 year ago

This is a valid issue, the check logic should be updated.