-
Notifications
You must be signed in to change notification settings - Fork 53
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
Shared Stops Validator: Validate feed_id
#557
Conversation
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.
I don't really see an alternative to using JDBCFetcher (this is the first use of it in DT). I guess the validation cannot be done in GTFS lib because you need the project's shared stop config and this transcends all feed versions so it can't be included there?
src/main/java/com/conveyal/datatools/manager/models/FeedVersion.java
Outdated
Show resolved
Hide resolved
src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java
Show resolved
Hide resolved
src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java
Show resolved
Hide resolved
Yeah we'd do all the validation in gtfs-lib but we don't have access to the feed info table in there |
Feed Info is loaded by GTFS-Lib it's just not made available in Feed. This could be updated to include feed info. But if I understand this correctly, GTFS Lib doesn't have the shard stop config so you'd still have a similar issue? |
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.
Happy to approve after discussing with Miles. This approach keeps GTFS-Lib clean.
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.
Works well. A nice-to-have would be to report the line number of the non-existing stop entity found.
src/main/java/com/conveyal/datatools/manager/jobs/validation/SharedStopsValidator.java
Show resolved
Hide resolved
// TODO: CHECK FEED ID (adjust the pre-build constructor to include feed_id) | ||
if (!stopIds.contains(stopId)) { | ||
// Make sure this error is only returned if we are inside the feed that is being checked | ||
if (feedId.equals(sharedStopFeedId) && !stopIds.contains(stopId)) { | ||
registerError(NewGTFSError.forFeed(NewGTFSErrorType.SHARED_STOP_GROUP_ENTITY_DOES_NOT_EXIST, stopId)); |
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.
Can you have this error be reported for the current line (instead of the entire feed) of the shared stops file?
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 shared stops file is not in Postgres so the validator can't talk to it. the stopId
links it to the stops file
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.
I was thinking of line numbers because the shared stops file is processed line by line using configReader.readRecord()
.
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.
Yes but unfortunately the validator doesn't know about those
Checklist
dev
before they can be merged tomaster
)Description
Builds on #552, only validating the shared stop if the feed_id of the feed matches the feed id of the row being validated