{"action":"opened","issue":{"url":"https://api.github.com/repos/OneBusAway/onebusaway-gtfs-modules/issues/48","labels_url":"https://api.github.com/repos/OneBusAway/onebusaway-gtfs-modules/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/OneBusAway/onebusaway-gtfs-modules/issues/48/comments","events_url":"https://api.github.com/repos/OneBusAway/onebusaway-gtfs-modules/issues/48/events","html_url":"https://github.com/OneBusAway/onebusaway-gtfs-modules/issues/48","id":71786228,"number":48,"title":"Support dynamic value assignment in GTFS transformer \"update\" operation","user":{"login":"bdferris","id":630674,"avatar_url":"https://avatars.githubusercontent.com/u/630674?v=3","gravatar_id":"","url":"https://api.github.com/users/bdferris","html_url":"https://github.com/bdferris","followers_url":"https://api.github.com/users/bdferris/followers","following_url":"https://api.github.com/users/bdferris/following{/other_user}","gists_url":"https://api.github.com/users/bdferris/gists{/gist_id}","starred_url":"https://api.github.com/users/bdferris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdferris/subscriptions","organizations_url":"https://api.github.com/users/bdferris/orgs","repos_url":"https://api.github.com/users/bdferris/repos","events_url":"https://api.github.com/users/bdferris/events{/privacy}","received_events_url":"https://api.github.com/users/bdferris/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-29T05:52:27Z","updated_at":"2015-04-29T05:52:27Z","closed_at":null,"body":"I'd like to be able to specify a transform like the following:\r\n\r\n    {\r\n      \"op\": \"update\",\r\n      \"match\": {\"file\": \"trips.txt\"},\r\n      \"update\": {\"trip_short_name\": \"eval(route.route_short_name)\"}\r\n    }\r\n\r\nThis is an update op that matches all entries in trips.txt, updating the trip_short_name, but with a wrinkle.  Normally, the update op would use the literal string paired with the \"trip_short_name\" key as the new value.  However, I'd like the value to instead be dynamically evaluated against the current entity itself.  In this case, evaluating against the trip's route's route_short_name.\r\n\r\nTo help indicate that the update value should be dynamically evaluated, I propose introducing the \"eval(...)\" keyword.  This keyword is unlikely to ever be needed as a literal update value in a GTFS transform, so I think it makes a good candidate for concisely indicating dynamic value.\r\n\r\nI know what you are thinking: why would anyone ever want to set their trip_short_name to be equal to their route_short_name?  This scenario really has come up with a feed I'm working on (plus some other related transforms)."}}