Skip to content

Commit

Permalink
refactor(PR feedback): Addressed typos and removed commented code.
Browse files Browse the repository at this point in the history
  • Loading branch information
br648 committed Sep 4, 2024
1 parent c1b51eb commit 0f8adce
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 45 deletions.
42 changes: 21 additions & 21 deletions src/main/java/com/conveyal/gtfs/error/NewGTFSErrorType.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@ public enum NewGTFSErrorType {
DUPLICATE_TRIP(Priority.MEDIUM, "More than one trip had an identical schedule and stops."),
FARE_TRANSFER_MISMATCH(Priority.MEDIUM, "A fare that does not permit transfers has a non-zero transfer duration."),
FEED_TRAVEL_TIMES_ROUNDED(Priority.LOW, "All travel times in the feed are rounded to the minute, which may cause unexpected results in routing applications where travel times are zero."),
FLEX_FORBIDDEN_ARRIVAL_TIME(Priority.HIGH, "arrival_time is not allow when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined."),
FLEX_FORBIDDEN_CONTINUOUS_DROP_OFF(Priority.HIGH, "continuous_drop_off is not allow when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined."),
FLEX_FORBIDDEN_CONTINUOUS_PICKUP(Priority.HIGH, "continuous_pickup is not allow when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined."),
FLEX_FORBIDDEN_DEPARTURE_TIME(Priority.HIGH, "departure_time is not allow when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined."),
FLEX_FORBIDDEN_DROP_OFF_TYPE(Priority.HIGH, "drop_off_type of 0 (Regularly scheduled pickup) is not allow when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined."),
FLEX_FORBIDDEN_ARRIVAL_TIME(Priority.HIGH, "arrival_time is not allowed when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined."),
FLEX_FORBIDDEN_CONTINUOUS_DROP_OFF(Priority.HIGH, "continuous_drop_off is not allowed when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined."),
FLEX_FORBIDDEN_CONTINUOUS_PICKUP(Priority.HIGH, "continuous_pickup is not allowed when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined."),
FLEX_FORBIDDEN_DEPARTURE_TIME(Priority.HIGH, "departure_time is not allowed when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined."),
FLEX_FORBIDDEN_DROP_OFF_TYPE(Priority.HIGH, "drop_off_type of 0 (Regularly scheduled pickup) is not allowed when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined."),
FLEX_FORBIDDEN_DUPLICATE_LOCATION_GROUP_ID(Priority.HIGH, "location_group_id that matches a stop_id or location_id is not allow."),
FLEX_FORBIDDEN_LOCATION_GROUP_ID(Priority.HIGH, "location_group_id is not allow if a stop_id or location_id is defined."),
FLEX_FORBIDDEN_LOCATION_GROUP_ID(Priority.HIGH, "location_group_id is not allowed if a stop_id or location_id is defined."),
FLEX_FORBIDDEN_DUPLICATE_LOCATION_ID(Priority.HIGH, "location_id that matches a stop_id or location_group_id is not allow."),
FLEX_FORBIDDEN_LOCATION_ID(Priority.HIGH, "location_id is not allow if a stop_id or location_group_id is defined."),
FLEX_FORBIDDEN_START_PICKUP_DROP_OFF_WINDOW(Priority.HIGH, "start_pickup_drop_off_window is not allow when either an arrive_time or departure_time is defined."),
FLEX_FORBIDDEN_END_PICKUP_DROP_OFF_WINDOW(Priority.HIGH, "end_pickup_drop_off_window is not allow when either an arrive_time or departure_time is defined."),
FLEX_FORBIDDEN_PICKUP_TYPE(Priority.HIGH, "pickup_type of 0 (Regularly scheduled pickup) or 3 (Must coordinate with driver to arrange pickup) is not allow when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined."),
FLEX_FORBIDDEN_PICKUP_TYPE_FOR_LOCATION(Priority.HIGH, "pickup_type of 3 (Must coordinate with driver to arrange pickup) is not allow when a stop_id refers to a location."),
FLEX_FORBIDDEN_PRIOR_NOTICE_DURATION_MIN(Priority.HIGH, "prior_notice_duration_min is not allow unless booking_type is 1 (Up to same-day booking with advance notice)."),
FLEX_FORBIDDEN_PRIOR_NOTICE_DURATION_MAX(Priority.HIGH, "prior_notice_duration_max is not allow for booking_type 0 (Real time booking) or 2 (Up to prior day(s) booking)."),
FLEX_FORBIDDEN_PRIOR_NOTICE_LAST_DAY(Priority.HIGH, "prior_notice_last_day is not allow for booking_type 2 (Up to prior day(s) booking)."),
FLEX_FORBIDDEN_PRIOR_NOTICE_SERVICE_ID(Priority.HIGH, "prior_notice_service_id is not allow if prior_notice_start_day is not defined."),
FLEX_FORBIDDEN_PRIOR_NOTICE_START_DAY_FOR_BOOKING_TYPE(Priority.HIGH, "prior_notice_start_day is not allow for booking_type 0 (Real time booking)."),
FLEX_FORBIDDEN_PRIOR_NOTICE_START_DAY(Priority.HIGH, "prior_notice_start_day is not allow for booking_type 1 (Up to same-day booking with advance notice) if prior_notice_duration_max is defined."),
FLEX_FORBIDDEN_PRIOR_START_TIME(Priority.HIGH, "prior_notice_start_time is not allow if prior_notice_start_day is not defined."),
FLEX_FORBIDDEN_STOP_ID(Priority.HIGH, "stop_id is not allow if a location_group_id or location_id is defined."),
FLEX_FORBIDDEN_ROUTE_CONTINUOUS_DROP_OFF(Priority.HIGH, "continuous_drop_off is not allow when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined for any trip on this route."),
FLEX_FORBIDDEN_ROUTE_CONTINUOUS_PICKUP(Priority.HIGH, "continuous_pick_up is not allow when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined for any trip on this route."),
FLEX_FORBIDDEN_LOCATION_ID(Priority.HIGH, "location_id is not allowed if a stop_id or location_group_id is defined."),
FLEX_FORBIDDEN_START_PICKUP_DROP_OFF_WINDOW(Priority.HIGH, "start_pickup_drop_off_window is not allowed when either an arrive_time or departure_time is defined."),
FLEX_FORBIDDEN_END_PICKUP_DROP_OFF_WINDOW(Priority.HIGH, "end_pickup_drop_off_window is not allowed when either an arrive_time or departure_time is defined."),
FLEX_FORBIDDEN_PICKUP_TYPE(Priority.HIGH, "pickup_type of 0 (Regularly scheduled pickup) or 3 (Must coordinate with driver to arrange pickup) is not allowed when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined."),
FLEX_FORBIDDEN_PICKUP_TYPE_FOR_LOCATION(Priority.HIGH, "pickup_type of 3 (Must coordinate with driver to arrange pickup) is not allowed when a stop_id refers to a location."),
FLEX_FORBIDDEN_PRIOR_NOTICE_DURATION_MIN(Priority.HIGH, "prior_notice_duration_min is not allowed unless booking_type is 1 (Up to same-day booking with advance notice)."),
FLEX_FORBIDDEN_PRIOR_NOTICE_DURATION_MAX(Priority.HIGH, "prior_notice_duration_max is not allowed for booking_type 0 (Real time booking) or 2 (Up to prior day(s) booking)."),
FLEX_FORBIDDEN_PRIOR_NOTICE_LAST_DAY(Priority.HIGH, "prior_notice_last_day is not allowed for booking_type 2 (Up to prior day(s) booking)."),
FLEX_FORBIDDEN_PRIOR_NOTICE_SERVICE_ID(Priority.HIGH, "prior_notice_service_id is not allowed if prior_notice_start_day is not defined."),
FLEX_FORBIDDEN_PRIOR_NOTICE_START_DAY_FOR_BOOKING_TYPE(Priority.HIGH, "prior_notice_start_day is not allowed for booking_type 0 (Real time booking)."),
FLEX_FORBIDDEN_PRIOR_NOTICE_START_DAY(Priority.HIGH, "prior_notice_start_day is not allowed for booking_type 1 (Up to same-day booking with advance notice) if prior_notice_duration_max is defined."),
FLEX_FORBIDDEN_PRIOR_START_TIME(Priority.HIGH, "prior_notice_start_time is not allowed if prior_notice_start_day is not defined."),
FLEX_FORBIDDEN_STOP_ID(Priority.HIGH, "stop_id is not allowed if a location_group_id or location_id is defined."),
FLEX_FORBIDDEN_ROUTE_CONTINUOUS_DROP_OFF(Priority.HIGH, "continuous_drop_off is not allowed when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined for any trip on this route."),
FLEX_FORBIDDEN_ROUTE_CONTINUOUS_PICKUP(Priority.HIGH, "continuous_pick_up is not allowed when either start_pickup_drop_off_window or end_pickup_drop_off_window is defined for any trip on this route."),
FLEX_REQUIRED_END_PICKUP_DROP_OFF_WINDOW(Priority.HIGH, "end_pickup_drop_off_window is required if a location_group_id, location_id or start_pickup_drop_off_window is defined."),
FLEX_REQUIRED_PRIOR_NOTICE_DURATION_MIN(Priority.HIGH, "prior_notice_duration_min is required for booking_type 1 (Up to same-day booking with advance notice)."),
FLEX_REQUIRED_PRIOR_NOTICE_LAST_DAY(Priority.HIGH, "prior_notice_last_day is required if a stop_id refers to a location group or location."),
Expand Down
24 changes: 0 additions & 24 deletions src/main/java/com/conveyal/gtfs/graphql/GraphQLGtfsSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -1079,36 +1079,13 @@ public class GraphQLGtfsSchema {
)
.build();

/**
* A top-level query that returns all of the patterns that serve a given stop ID. This demonstrates the use of
* NestedJDBCFetcher.
*/
// private static GraphQLObjectType patternsForStopQuery = newObject()
// .name("patternsForStopQuery")
// .field(newFieldDefinition()
// .name("patternsForStop")
// // Field type should be equivalent to the final JDBCFetcher table type.
// .type(new GraphQLList(patternType))
// // We scope to a single feed namespace, otherwise GTFS entity IDs are ambiguous.
// .argument(stringArg("namespace"))
// // We allow querying only for a single stop, otherwise result processing can take a long time (lots
// // of join queries).
// .argument(stringArg("stop_id"))
// .dataFetcher(new NestedJDBCFetcher(
// new JDBCFetcher("pattern_stops", "stop_id"),
// new JDBCFetcher("patterns", "pattern_id")))
// .build())
// .build();


/**
* This is the new schema as of July 2017, where all sub-entities are wrapped in a feed.
* Because all of these fields are static (ugh) this must be declared after the feedQuery it references.
*/
public static final GraphQLSchema feedBasedSchema = GraphQLSchema
.newSchema()
.query(feedQuery)
// .query(patternsForStopQuery)
.build();


Expand All @@ -1118,7 +1095,6 @@ public Object serialize(Object input) {
String[] strings = new String[] {};
try {
strings = (String[]) ((Array) input).getArray();
// if (strings == null) strings = new String[]{};
} catch (SQLException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit 0f8adce

Please sign in to comment.