{"action":"created","issue":{"url":"https://api.github.com/repos/mila-udem/fuel/issues/381","repository_url":"https://api.github.com/repos/mila-udem/fuel","labels_url":"https://api.github.com/repos/mila-udem/fuel/issues/381/labels{/name}","comments_url":"https://api.github.com/repos/mila-udem/fuel/issues/381/comments","events_url":"https://api.github.com/repos/mila-udem/fuel/issues/381/events","html_url":"https://github.com/mila-udem/fuel/pull/381","id":206314533,"number":381,"title":"Make mapping transformer accept dictionary","user":{"login":"dmitriy-serdyuk","id":2872615,"avatar_url":"https://avatars.githubusercontent.com/u/2872615?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitriy-serdyuk","html_url":"https://github.com/dmitriy-serdyuk","followers_url":"https://api.github.com/users/dmitriy-serdyuk/followers","following_url":"https://api.github.com/users/dmitriy-serdyuk/following{/other_user}","gists_url":"https://api.github.com/users/dmitriy-serdyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriy-serdyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriy-serdyuk/subscriptions","organizations_url":"https://api.github.com/users/dmitriy-serdyuk/orgs","repos_url":"https://api.github.com/users/dmitriy-serdyuk/repos","events_url":"https://api.github.com/users/dmitriy-serdyuk/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriy-serdyuk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-08T20:26:57Z","updated_at":"2017-02-08T22:12:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mila-udem/fuel/pulls/381","html_url":"https://github.com/mila-udem/fuel/pull/381","diff_url":"https://github.com/mila-udem/fuel/pull/381.diff","patch_url":"https://github.com/mila-udem/fuel/pull/381.patch"},"body":"I frequently feel frustrated that when I change my data pipeline some mapping transformer in the middle receives a different number of arguments. Now it is possible to work with a dictionary rather than with a tuple:\r\n\r\n```python\r\n# Python3:\r\ndef double_square(data: dict):\r\n    return 2 * data['features'], (data['targets']) ** 2\r\nstream = Mapping(stream, double_square)\r\n\r\n# Python2:\r\nfrom fuel.utils import accepts_dict\r\n@accepts_dict\r\ndef double_square(data):\r\n    return 2 * data['features'], (data['targets']) ** 2\r\nstream = Mapping(stream, double_square)\r\n```\r\n\r\nFixes #372."},"comment":{"url":"https://api.github.com/repos/mila-udem/fuel/issues/comments/278478824","html_url":"https://github.com/mila-udem/fuel/pull/381#issuecomment-278478824","issue_url":"https://api.github.com/repos/mila-udem/fuel/issues/381","id":278478824,"user":{"login":"dmitriy-serdyuk","id":2872615,"avatar_url":"https://avatars.githubusercontent.com/u/2872615?v=3","gravatar_id":"","url":"https://api.github.com/users/dmitriy-serdyuk","html_url":"https://github.com/dmitriy-serdyuk","followers_url":"https://api.github.com/users/dmitriy-serdyuk/followers","following_url":"https://api.github.com/users/dmitriy-serdyuk/following{/other_user}","gists_url":"https://api.github.com/users/dmitriy-serdyuk/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitriy-serdyuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitriy-serdyuk/subscriptions","organizations_url":"https://api.github.com/users/dmitriy-serdyuk/orgs","repos_url":"https://api.github.com/users/dmitriy-serdyuk/repos","events_url":"https://api.github.com/users/dmitriy-serdyuk/events{/privacy}","received_events_url":"https://api.github.com/users/dmitriy-serdyuk/received_events","type":"User","site_admin":false},"created_at":"2017-02-08T22:12:48Z","updated_at":"2017-02-08T22:12:48Z","body":"Last commit is just refactoring while I'm at it and can be reviewed separately."}}
{"actor":{"display_login":"dmitriy-serdyuk"}}