OneBusAway / onebusaway-gtfs-modules

A Java-based library for reading, writing, and transforming public transit data in the GTFS format, including database support.
Other
129 stars 106 forks source link

FeedInfoFromAgencyStrat compatable with SimpleModificationStrat #215

Closed CaylaSavitzky closed 1 year ago

CaylaSavitzky commented 1 year ago

Summary:

FeedInfoFromAgencyStrategy could create duplicates if it was run with a SimpleModificationStrategy ("update") that changed the feed_id of a feed.

caused by “update” transformation is not updating the feed_id key GenericDaoImpl.entitiesByClassAndId when it updates the value of feed_id (and it looks like it's not updating any of the id when changed)

sample transforms to create problem:

{"op":"update","match":{"file":"feed_info.txt"}, "update":{"feed_id": "5"}} }}} {"op":"transform", "class":"org.onebusaway.gtfs_transformer.impl.FeedInfoFromAgencyStrategy", "agency_id":"5"}

Expected behavior:

the above sample code will no longer create duplicates

Please make sure these boxes are checked before submitting your pull request - thanks!

sheldonabrown commented 1 year ago

Thanks @CaylaSavitzky