{"action":"opened","number":201,"pull_request":{"url":"https://api.github.com/repos/onyxfish/agate/pulls/201","id":43893099,"html_url":"https://github.com/onyxfish/agate/pull/201","diff_url":"https://github.com/onyxfish/agate/pull/201.diff","patch_url":"https://github.com/onyxfish/agate/pull/201.patch","issue_url":"https://api.github.com/repos/onyxfish/agate/issues/201","number":201,"state":"open","locked":false,"title":"Fix some syntax errors in the tutorial","user":{"login":"nsonnad","id":1362219,"avatar_url":"https://avatars.githubusercontent.com/u/1362219?v=3","gravatar_id":"","url":"https://api.github.com/users/nsonnad","html_url":"https://github.com/nsonnad","followers_url":"https://api.github.com/users/nsonnad/followers","following_url":"https://api.github.com/users/nsonnad/following{/other_user}","gists_url":"https://api.github.com/users/nsonnad/gists{/gist_id}","starred_url":"https://api.github.com/users/nsonnad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsonnad/subscriptions","organizations_url":"https://api.github.com/users/nsonnad/orgs","repos_url":"https://api.github.com/users/nsonnad/repos","events_url":"https://api.github.com/users/nsonnad/events{/privacy}","received_events_url":"https://api.github.com/users/nsonnad/received_events","type":"User","site_admin":false},"body":"Just ran through the tutorial and came across a few small errors. Fixed 'em.\r\n\r\nOne related thing that is weird and maybe deserving of a separate issue: Putting the `agate.Formula` second in the list of computations appeared to make agate try to cast it as a decimal, which failed. I swapped in the tutorial to get it to work (since the same formula worked fine when it was the only list item), but seems like an issue with the type specification.\r\n\r\nHere's a stack trace:\r\n\r\n```python\r\nIn [51]: with_computations = exonerations.compute([\r\n('years_in_prison', agate.Change('convicted', 'exonerated')),\r\n('full_name', agate.Formula(text_type, lambda row: '%(first_name)s %(last_name)s' % row))\r\n])\r\n---------------------------------------------------------------------------\r\nCastError                                 Traceback (most recent call last)\r\n<ipython-input-51-2560a46849b8> in <module>()\r\n      1 with_computations = exonerations.compute([\r\n      2 ('years_in_prison', agate.Change('convicted', 'exonerated')),\r\n----> 3 ('full_name', agate.Formula(text_type, lambda row: '%(first_name)s %(last_name)s' % row))\r\n      4 ])\r\n\r\n/Users/nikhil/docs/learn/py/agate_tutorial/env/lib/python2.7/site-packages/agate/table.pyc in compute(self, computations)\r\n    582             new_rows.append(tuple(row) + new_columns)\r\n    583\r\n--> 584         return self._fork(new_rows, zip(column_names, column_types))\r\n    585\r\n    586     def format(self, max_rows=None, max_columns=None):\r\n\r\n/Users/nikhil/docs/learn/py/agate_tutorial/env/lib/python2.7/site-packages/agate/table.pyc in _fork(self, rows, column_info)\r\n    124             column_info = zip(self._column_names, self._column_types)\r\n    125\r\n--> 126         return Table(rows, column_info)\r\n    127\r\n    128     @classmethod\r\n\r\n/Users/nikhil/docs/learn/py/agate_tutorial/env/lib/python2.7/site-packages/agate/table.pyc in __init__(self, rows, column_info)\r\n     85                 continue\r\n     86\r\n---> 87             cast_data.append(tuple(cast_funcs[i](d) for i, d in enumerate(row)))\r\n     88\r\n     89         self._data = tuple(cast_data)\r\n\r\n/Users/nikhil/docs/learn/py/agate_tutorial/env/lib/python2.7/site-packages/agate/table.pyc in <genexpr>((i, d))\r\n     85                 continue\r\n     86\r\n---> 87             cast_data.append(tuple(cast_funcs[i](d) for i, d in enumerate(row)))\r\n     88\r\n     89         self._data = tuple(cast_data)\r\n\r\n/Users/nikhil/docs/learn/py/agate_tutorial/env/lib/python2.7/site-packages/agate/column_types.pyc in cast(self, d)\r\n    197             return Decimal(d)\r\n    198         except InvalidOperation:\r\n--> 199             raise CastError('Can not convert value \"%s\" to Decimal for NumberColumn.' % d)\r\n    200\r\n    201     def _create_column(self, table, index):\r\n\r\nCastError: Can not convert value \"Joseph Lamont Abbitt\" to Decimal for NumberColumn.\r\n```","created_at":"2015-09-01T15:54:51Z","updated_at":"2015-09-01T15:54:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/onyxfish/agate/pulls/201/commits","review_comments_url":"https://api.github.com/repos/onyxfish/agate/pulls/201/comments","review_comment_url":"https://api.github.com/repos/onyxfish/agate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/onyxfish/agate/issues/201/comments","statuses_url":"https://api.github.com/repos/onyxfish/agate/statuses/b0de90914f127da5e1964b311d6dfbc558331522","head":{"label":"nsonnad:tutorial-syntax-fixes","ref":"tutorial-syntax-fixes","sha":"b0de90914f127da5e1964b311d6dfbc558331522","user":{"login":"nsonnad","id":1362219,"avatar_url":"https://avatars.githubusercontent.com/u/1362219?v=3","gravatar_id":"","url":"https://api.github.com/users/nsonnad","html_url":"https://github.com/nsonnad","followers_url":"https://api.github.com/users/nsonnad/followers","following_url":"https://api.github.com/users/nsonnad/following{/other_user}","gists_url":"https://api.github.com/users/nsonnad/gists{/gist_id}","starred_url":"https://api.github.com/users/nsonnad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsonnad/subscriptions","organizations_url":"https://api.github.com/users/nsonnad/orgs","repos_url":"https://api.github.com/users/nsonnad/repos","events_url":"https://api.github.com/users/nsonnad/events{/privacy}","received_events_url":"https://api.github.com/users/nsonnad/received_events","type":"User","site_admin":false},"repo":{"id":41746930,"name":"agate","full_name":"nsonnad/agate","owner":{"login":"nsonnad","id":1362219,"avatar_url":"https://avatars.githubusercontent.com/u/1362219?v=3","gravatar_id":"","url":"https://api.github.com/users/nsonnad","html_url":"https://github.com/nsonnad","followers_url":"https://api.github.com/users/nsonnad/followers","following_url":"https://api.github.com/users/nsonnad/following{/other_user}","gists_url":"https://api.github.com/users/nsonnad/gists{/gist_id}","starred_url":"https://api.github.com/users/nsonnad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsonnad/subscriptions","organizations_url":"https://api.github.com/users/nsonnad/orgs","repos_url":"https://api.github.com/users/nsonnad/repos","events_url":"https://api.github.com/users/nsonnad/events{/privacy}","received_events_url":"https://api.github.com/users/nsonnad/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nsonnad/agate","description":"agate is a Python data analysis library designed for humans working in the real world.","fork":true,"url":"https://api.github.com/repos/nsonnad/agate","forks_url":"https://api.github.com/repos/nsonnad/agate/forks","keys_url":"https://api.github.com/repos/nsonnad/agate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nsonnad/agate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nsonnad/agate/teams","hooks_url":"https://api.github.com/repos/nsonnad/agate/hooks","issue_events_url":"https://api.github.com/repos/nsonnad/agate/issues/events{/number}","events_url":"https://api.github.com/repos/nsonnad/agate/events","assignees_url":"https://api.github.com/repos/nsonnad/agate/assignees{/user}","branches_url":"https://api.github.com/repos/nsonnad/agate/branches{/branch}","tags_url":"https://api.github.com/repos/nsonnad/agate/tags","blobs_url":"https://api.github.com/repos/nsonnad/agate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nsonnad/agate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nsonnad/agate/git/refs{/sha}","trees_url":"https://api.github.com/repos/nsonnad/agate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nsonnad/agate/statuses/{sha}","languages_url":"https://api.github.com/repos/nsonnad/agate/languages","stargazers_url":"https://api.github.com/repos/nsonnad/agate/stargazers","contributors_url":"https://api.github.com/repos/nsonnad/agate/contributors","subscribers_url":"https://api.github.com/repos/nsonnad/agate/subscribers","subscription_url":"https://api.github.com/repos/nsonnad/agate/subscription","commits_url":"https://api.github.com/repos/nsonnad/agate/commits{/sha}","git_commits_url":"https://api.github.com/repos/nsonnad/agate/git/commits{/sha}","comments_url":"https://api.github.com/repos/nsonnad/agate/comments{/number}","issue_comment_url":"https://api.github.com/repos/nsonnad/agate/issues/comments{/number}","contents_url":"https://api.github.com/repos/nsonnad/agate/contents/{+path}","compare_url":"https://api.github.com/repos/nsonnad/agate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nsonnad/agate/merges","archive_url":"https://api.github.com/repos/nsonnad/agate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nsonnad/agate/downloads","issues_url":"https://api.github.com/repos/nsonnad/agate/issues{/number}","pulls_url":"https://api.github.com/repos/nsonnad/agate/pulls{/number}","milestones_url":"https://api.github.com/repos/nsonnad/agate/milestones{/number}","notifications_url":"https://api.github.com/repos/nsonnad/agate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nsonnad/agate/labels{/name}","releases_url":"https://api.github.com/repos/nsonnad/agate/releases{/id}","created_at":"2015-09-01T15:29:21Z","updated_at":"2015-09-01T15:29:21Z","pushed_at":"2015-09-01T15:47:58Z","git_url":"git://github.com/nsonnad/agate.git","ssh_url":"git@github.com:nsonnad/agate.git","clone_url":"https://github.com/nsonnad/agate.git","svn_url":"https://github.com/nsonnad/agate","homepage":"http://agate.readthedocs.org/","size":1223,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"onyxfish:master","ref":"master","sha":"d0c9ee1faaede9b52d27195f023620ca5a7ded46","user":{"login":"onyxfish","id":33046,"avatar_url":"https://avatars.githubusercontent.com/u/33046?v=3","gravatar_id":"","url":"https://api.github.com/users/onyxfish","html_url":"https://github.com/onyxfish","followers_url":"https://api.github.com/users/onyxfish/followers","following_url":"https://api.github.com/users/onyxfish/following{/other_user}","gists_url":"https://api.github.com/users/onyxfish/gists{/gist_id}","starred_url":"https://api.github.com/users/onyxfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onyxfish/subscriptions","organizations_url":"https://api.github.com/users/onyxfish/orgs","repos_url":"https://api.github.com/users/onyxfish/repos","events_url":"https://api.github.com/users/onyxfish/events{/privacy}","received_events_url":"https://api.github.com/users/onyxfish/received_events","type":"User","site_admin":false},"repo":{"id":19147961,"name":"agate","full_name":"onyxfish/agate","owner":{"login":"onyxfish","id":33046,"avatar_url":"https://avatars.githubusercontent.com/u/33046?v=3","gravatar_id":"","url":"https://api.github.com/users/onyxfish","html_url":"https://github.com/onyxfish","followers_url":"https://api.github.com/users/onyxfish/followers","following_url":"https://api.github.com/users/onyxfish/following{/other_user}","gists_url":"https://api.github.com/users/onyxfish/gists{/gist_id}","starred_url":"https://api.github.com/users/onyxfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onyxfish/subscriptions","organizations_url":"https://api.github.com/users/onyxfish/orgs","repos_url":"https://api.github.com/users/onyxfish/repos","events_url":"https://api.github.com/users/onyxfish/events{/privacy}","received_events_url":"https://api.github.com/users/onyxfish/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/onyxfish/agate","description":"agate is a Python data analysis library designed for humans working in the real world.","fork":false,"url":"https://api.github.com/repos/onyxfish/agate","forks_url":"https://api.github.com/repos/onyxfish/agate/forks","keys_url":"https://api.github.com/repos/onyxfish/agate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onyxfish/agate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onyxfish/agate/teams","hooks_url":"https://api.github.com/repos/onyxfish/agate/hooks","issue_events_url":"https://api.github.com/repos/onyxfish/agate/issues/events{/number}","events_url":"https://api.github.com/repos/onyxfish/agate/events","assignees_url":"https://api.github.com/repos/onyxfish/agate/assignees{/user}","branches_url":"https://api.github.com/repos/onyxfish/agate/branches{/branch}","tags_url":"https://api.github.com/repos/onyxfish/agate/tags","blobs_url":"https://api.github.com/repos/onyxfish/agate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onyxfish/agate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onyxfish/agate/git/refs{/sha}","trees_url":"https://api.github.com/repos/onyxfish/agate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onyxfish/agate/statuses/{sha}","languages_url":"https://api.github.com/repos/onyxfish/agate/languages","stargazers_url":"https://api.github.com/repos/onyxfish/agate/stargazers","contributors_url":"https://api.github.com/repos/onyxfish/agate/contributors","subscribers_url":"https://api.github.com/repos/onyxfish/agate/subscribers","subscription_url":"https://api.github.com/repos/onyxfish/agate/subscription","commits_url":"https://api.github.com/repos/onyxfish/agate/commits{/sha}","git_commits_url":"https://api.github.com/repos/onyxfish/agate/git/commits{/sha}","comments_url":"https://api.github.com/repos/onyxfish/agate/comments{/number}","issue_comment_url":"https://api.github.com/repos/onyxfish/agate/issues/comments{/number}","contents_url":"https://api.github.com/repos/onyxfish/agate/contents/{+path}","compare_url":"https://api.github.com/repos/onyxfish/agate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onyxfish/agate/merges","archive_url":"https://api.github.com/repos/onyxfish/agate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onyxfish/agate/downloads","issues_url":"https://api.github.com/repos/onyxfish/agate/issues{/number}","pulls_url":"https://api.github.com/repos/onyxfish/agate/pulls{/number}","milestones_url":"https://api.github.com/repos/onyxfish/agate/milestones{/number}","notifications_url":"https://api.github.com/repos/onyxfish/agate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onyxfish/agate/labels{/name}","releases_url":"https://api.github.com/repos/onyxfish/agate/releases{/id}","created_at":"2014-04-25T13:59:09Z","updated_at":"2015-09-01T13:53:18Z","pushed_at":"2015-09-01T15:54:51Z","git_url":"git://github.com/onyxfish/agate.git","ssh_url":"git@github.com:onyxfish/agate.git","clone_url":"https://github.com/onyxfish/agate.git","svn_url":"https://github.com/onyxfish/agate","homepage":"http://agate.readthedocs.org/","size":1223,"stargazers_count":95,"watchers_count":95,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":31,"forks":23,"open_issues":31,"watchers":95,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/onyxfish/agate/pulls/201"},"html":{"href":"https://github.com/onyxfish/agate/pull/201"},"issue":{"href":"https://api.github.com/repos/onyxfish/agate/issues/201"},"comments":{"href":"https://api.github.com/repos/onyxfish/agate/issues/201/comments"},"review_comments":{"href":"https://api.github.com/repos/onyxfish/agate/pulls/201/comments"},"review_comment":{"href":"https://api.github.com/repos/onyxfish/agate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/onyxfish/agate/pulls/201/commits"},"statuses":{"href":"https://api.github.com/repos/onyxfish/agate/statuses/b0de90914f127da5e1964b311d6dfbc558331522"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":6,"deletions":6,"changed_files":1}}