Skip to content

Add notice for service_id with a big gap #2072

@skalexch

Description

@skalexch

Describe the problem

This notice exists in the legacy validator as ValidateServiceGaps (Google Type notice TYPE_FEED_SERVICE_DATE_GAP) (Warning in the legacy validator but should be an info).

If a service_id has a gap of over 13 days (default value in the legacy validator), the notice will be triggered. This one is nice in theory but has two problems:

  • Maybe there is a legitimate reason for the gap. But it's still an info so it is harmless.
  • It might be complicated to implement. We need to group by the service_id, including exceptions as well, then search within the service range for any gaps.

Describe the new validation rule

Related spec language Rationale for rule Notice name to update or add Pseudologic Notice table columns Severity Notice description
calendar.service_id, calendar.start_date, calendar.start_date, calendar_dates.service_id, calendar_dates.date A service should not have a gap of two weeks or more service_gap For each service_id, construct all days in which the service is valid, by including the intervals from calendar.txt, removing intervals extremities where the value of the weekday is 0, as well as adding and removing exceptions from calendar_dates.txt.

Calculate the biggest gap inside the final service range.
If the gap is > 13 days: Trigger notice
serviceId INFO A service has a gap of over 13 days.

Sample GTFS datasets

No response

Severity

INFO

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions