GitHub PullRequestReviewCommentEvent at 2014-06-17 15:17:47
Repository: blaze
Actor: mrocklin
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/ContinuumIO/blaze/pulls/comments/13864993","id":13864993,"diff_hunk":"@@ -0,0 +1,67 @@\n+from flask import json\n+\n+from blaze.serve.server import Server\n+from blaze.data.python import Python\n+from blaze.serve.index import parse_index, emit_index\n+\n+accounts = Python([['Alice', 100], ['Bob', 200]],\n+                  schema='{name: string, amount: int32}')\n+\n+cities = Python([['Alice', 'NYC'], ['Bob', 'LA'], ['Charlie', 'Beijing']],\n+                  schema='{name: string, city: string}')\n+\n+server = Server(datasets={'accounts': accounts, 'cities': cities})\n+\n+test = server.app.test_client()\n+\n+def test_full_response():\n+    py_index = (slice(0, None), 'name')\n+    json_index = [{'start': 0, 'stop': None}, 'name']\n+\n+    response = test.post('/data/accounts.json',\n+                         data = json.dumps({'index': emit_index(py_index)}),\n+                         content_type='application/json')\n+\n+    assert json.loads(response.data) == \\\n+            {'name': 'accounts',\n+             'datashape': \"var * string\",\n+             'index': json_index,\n+             'data': ['Alice', 'Bob']}\n+\n+\n+def test_datasets():\n+    response = test.get('/datasets.json')\n+    assert json.loads(response.data) == {'accounts': str(accounts.dshape),\n+                                         'cities': str(cities.dshape)}\n+\n+\n+def test_data():\n+    pairs = [(0, ['Alice', 100]),\n+             ((0, 0), 'Alice'),\n+             ((0, 'name'), 'Alice'),\n+             ((slice(0, None), 'name'), ['Alice', 'Bob'])]\n+\n+\n+    for ind, expected in pairs:\n+        index = {'index': emit_index(ind)}\n+\n+        response = test.post('/data/accounts.json',\n+                             data = json.dumps(index),","path":"blaze/serve/tests/test_server.py","position":49,"original_position":49,"commit_id":"dbc202c6b524a39b34c04b3176a849bb1e616836","original_commit_id":"dbc202c6b524a39b34c04b3176a849bb1e616836","user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?","gravatar_id":"8749ec52cee260c4c1f67f2dec29d957","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"body":"@talumbau we use POST because we want to use `data=...`","created_at":"2014-06-17T15:17:47Z","updated_at":"2014-06-17T15:17:47Z","html_url":"https://github.com/ContinuumIO/blaze/pull/337#discussion_r13864993","pull_request_url":"https://api.github.com/repos/ContinuumIO/blaze/pulls/337","_links":{"self":{"href":"https://api.github.com/repos/ContinuumIO/blaze/pulls/comments/13864993"},"html":{"href":"https://github.com/ContinuumIO/blaze/pull/337#discussion_r13864993"},"pull_request":{"href":"https://api.github.com/repos/ContinuumIO/blaze/pulls/337"}}},"pull_request":{"url":"https://api.github.com/repos/ContinuumIO/blaze/pulls/337","id":17208093,"html_url":"https://github.com/ContinuumIO/blaze/pull/337","diff_url":"https://github.com/ContinuumIO/blaze/pull/337.diff","patch_url":"https://github.com/ContinuumIO/blaze/pull/337.patch","issue_url":"https://api.github.com/repos/ContinuumIO/blaze/issues/337","number":337,"state":"open","title":"Blaze server","user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?","gravatar_id":"8749ec52cee260c4c1f67f2dec29d957","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"body":"Here is a tiny replacement for catalog.  It doesn't do any of the directory management tasks but it does cleanly expose `getitem` over a simple HTTP API.  This API takes structured JSON data and so should be easy to interact with.  Because this interacts with the `blaze.data` getitem syntax this should extend to a variety of data formats.\r\n\r\ncc @mwiebe\r\n\r\nDisclaimer, my web-programming skillz could use some work.  Suggestions welcome.","created_at":"2014-06-16T23:01:29Z","updated_at":"2014-06-17T15:17:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b5926a41067086a4bd22208d2f9c60af5ce9f7c9","assignee":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?","gravatar_id":"8749ec52cee260c4c1f67f2dec29d957","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ContinuumIO/blaze/pulls/337/commits","review_comments_url":"https://api.github.com/repos/ContinuumIO/blaze/pulls/337/comments","review_comment_url":"https://api.github.com/repos/ContinuumIO/blaze/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ContinuumIO/blaze/issues/337/comments","statuses_url":"https://api.github.com/repos/ContinuumIO/blaze/statuses/dbc202c6b524a39b34c04b3176a849bb1e616836","head":{"label":"mrocklin:serve","ref":"serve","sha":"dbc202c6b524a39b34c04b3176a849bb1e616836","user":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?","gravatar_id":"8749ec52cee260c4c1f67f2dec29d957","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"repo":{"id":16621343,"name":"blaze","full_name":"mrocklin/blaze","owner":{"login":"mrocklin","id":306380,"avatar_url":"https://avatars.githubusercontent.com/u/306380?","gravatar_id":"8749ec52cee260c4c1f67f2dec29d957","url":"https://api.github.com/users/mrocklin","html_url":"https://github.com/mrocklin","followers_url":"https://api.github.com/users/mrocklin/followers","following_url":"https://api.github.com/users/mrocklin/following{/other_user}","gists_url":"https://api.github.com/users/mrocklin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrocklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrocklin/subscriptions","organizations_url":"https://api.github.com/users/mrocklin/orgs","repos_url":"https://api.github.com/users/mrocklin/repos","events_url":"https://api.github.com/users/mrocklin/events{/privacy}","received_events_url":"https://api.github.com/users/mrocklin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrocklin/blaze","description":"Blaze is NumPy and Pandas for Big Data","fork":true,"url":"https://api.github.com/repos/mrocklin/blaze","forks_url":"https://api.github.com/repos/mrocklin/blaze/forks","keys_url":"https://api.github.com/repos/mrocklin/blaze/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrocklin/blaze/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrocklin/blaze/teams","hooks_url":"https://api.github.com/repos/mrocklin/blaze/hooks","issue_events_url":"https://api.github.com/repos/mrocklin/blaze/issues/events{/number}","events_url":"https://api.github.com/repos/mrocklin/blaze/events","assignees_url":"https://api.github.com/repos/mrocklin/blaze/assignees{/user}","branches_url":"https://api.github.com/repos/mrocklin/blaze/branches{/branch}","tags_url":"https://api.github.com/repos/mrocklin/blaze/tags","blobs_url":"https://api.github.com/repos/mrocklin/blaze/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrocklin/blaze/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrocklin/blaze/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrocklin/blaze/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrocklin/blaze/statuses/{sha}","languages_url":"https://api.github.com/repos/mrocklin/blaze/languages","stargazers_url":"https://api.github.com/repos/mrocklin/blaze/stargazers","contributors_url":"https://api.github.com/repos/mrocklin/blaze/contributors","subscribers_url":"https://api.github.com/repos/mrocklin/blaze/subscribers","subscription_url":"https://api.github.com/repos/mrocklin/blaze/subscription","commits_url":"https://api.github.com/repos/mrocklin/blaze/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrocklin/blaze/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrocklin/blaze/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrocklin/blaze/issues/comments/{number}","contents_url":"https://api.github.com/repos/mrocklin/blaze/contents/{+path}","compare_url":"https://api.github.com/repos/mrocklin/blaze/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrocklin/blaze/merges","archive_url":"https://api.github.com/repos/mrocklin/blaze/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrocklin/blaze/downloads","issues_url":"https://api.github.com/repos/mrocklin/blaze/issues{/number}","pulls_url":"https://api.github.com/repos/mrocklin/blaze/pulls{/number}","milestones_url":"https://api.github.com/repos/mrocklin/blaze/milestones{/number}","notifications_url":"https://api.github.com/repos/mrocklin/blaze/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrocklin/blaze/labels{/name}","releases_url":"https://api.github.com/repos/mrocklin/blaze/releases{/id}","created_at":"2014-02-07T17:04:42Z","updated_at":"2014-06-17T00:22:13Z","pushed_at":"2014-06-17T00:22:13Z","git_url":"git://github.com/mrocklin/blaze.git","ssh_url":"git@github.com:mrocklin/blaze.git","clone_url":"https://github.com/mrocklin/blaze.git","svn_url":"https://github.com/mrocklin/blaze","homepage":"blaze.pydata.org","size":8768,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ContinuumIO:reorg","ref":"reorg","sha":"0ba2f41f9016fa1a9184cabd8eccad1c0a1e7512","user":{"login":"ContinuumIO","id":1158637,"avatar_url":"https://avatars.githubusercontent.com/u/1158637?","gravatar_id":"d3e1fbcfffa00b955ee75f4e4324d6e6","url":"https://api.github.com/users/ContinuumIO","html_url":"https://github.com/ContinuumIO","followers_url":"https://api.github.com/users/ContinuumIO/followers","following_url":"https://api.github.com/users/ContinuumIO/following{/other_user}","gists_url":"https://api.github.com/users/ContinuumIO/gists{/gist_id}","starred_url":"https://api.github.com/users/ContinuumIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ContinuumIO/subscriptions","organizations_url":"https://api.github.com/users/ContinuumIO/orgs","repos_url":"https://api.github.com/users/ContinuumIO/repos","events_url":"https://api.github.com/users/ContinuumIO/events{/privacy}","received_events_url":"https://api.github.com/users/ContinuumIO/received_events","type":"Organization","site_admin":false},"repo":{"id":6404963,"name":"blaze","full_name":"ContinuumIO/blaze","owner":{"login":"ContinuumIO","id":1158637,"avatar_url":"https://avatars.githubusercontent.com/u/1158637?","gravatar_id":"d3e1fbcfffa00b955ee75f4e4324d6e6","url":"https://api.github.com/users/ContinuumIO","html_url":"https://github.com/ContinuumIO","followers_url":"https://api.github.com/users/ContinuumIO/followers","following_url":"https://api.github.com/users/ContinuumIO/following{/other_user}","gists_url":"https://api.github.com/users/ContinuumIO/gists{/gist_id}","starred_url":"https://api.github.com/users/ContinuumIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ContinuumIO/subscriptions","organizations_url":"https://api.github.com/users/ContinuumIO/orgs","repos_url":"https://api.github.com/users/ContinuumIO/repos","events_url":"https://api.github.com/users/ContinuumIO/events{/privacy}","received_events_url":"https://api.github.com/users/ContinuumIO/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ContinuumIO/blaze","description":"Blaze is NumPy and Pandas for Big Data","fork":false,"url":"https://api.github.com/repos/ContinuumIO/blaze","forks_url":"https://api.github.com/repos/ContinuumIO/blaze/forks","keys_url":"https://api.github.com/repos/ContinuumIO/blaze/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ContinuumIO/blaze/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ContinuumIO/blaze/teams","hooks_url":"https://api.github.com/repos/ContinuumIO/blaze/hooks","issue_events_url":"https://api.github.com/repos/ContinuumIO/blaze/issues/events{/number}","events_url":"https://api.github.com/repos/ContinuumIO/blaze/events","assignees_url":"https://api.github.com/repos/ContinuumIO/blaze/assignees{/user}","branches_url":"https://api.github.com/repos/ContinuumIO/blaze/branches{/branch}","tags_url":"https://api.github.com/repos/ContinuumIO/blaze/tags","blobs_url":"https://api.github.com/repos/ContinuumIO/blaze/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ContinuumIO/blaze/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ContinuumIO/blaze/git/refs{/sha}","trees_url":"https://api.github.com/repos/ContinuumIO/blaze/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ContinuumIO/blaze/statuses/{sha}","languages_url":"https://api.github.com/repos/ContinuumIO/blaze/languages","stargazers_url":"https://api.github.com/repos/ContinuumIO/blaze/stargazers","contributors_url":"https://api.github.com/repos/ContinuumIO/blaze/contributors","subscribers_url":"https://api.github.com/repos/ContinuumIO/blaze/subscribers","subscription_url":"https://api.github.com/repos/ContinuumIO/blaze/subscription","commits_url":"https://api.github.com/repos/ContinuumIO/blaze/commits{/sha}","git_commits_url":"https://api.github.com/repos/ContinuumIO/blaze/git/commits{/sha}","comments_url":"https://api.github.com/repos/ContinuumIO/blaze/comments{/number}","issue_comment_url":"https://api.github.com/repos/ContinuumIO/blaze/issues/comments/{number}","contents_url":"https://api.github.com/repos/ContinuumIO/blaze/contents/{+path}","compare_url":"https://api.github.com/repos/ContinuumIO/blaze/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ContinuumIO/blaze/merges","archive_url":"https://api.github.com/repos/ContinuumIO/blaze/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ContinuumIO/blaze/downloads","issues_url":"https://api.github.com/repos/ContinuumIO/blaze/issues{/number}","pulls_url":"https://api.github.com/repos/ContinuumIO/blaze/pulls{/number}","milestones_url":"https://api.github.com/repos/ContinuumIO/blaze/milestones{/number}","notifications_url":"https://api.github.com/repos/ContinuumIO/blaze/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ContinuumIO/blaze/labels{/name}","releases_url":"https://api.github.com/repos/ContinuumIO/blaze/releases{/id}","created_at":"2012-10-26T14:25:22Z","updated_at":"2014-06-17T12:53:20Z","pushed_at":"2014-06-16T15:41:39Z","git_url":"git://github.com/ContinuumIO/blaze.git","ssh_url":"git@github.com:ContinuumIO/blaze.git","clone_url":"https://github.com/ContinuumIO/blaze.git","svn_url":"https://github.com/ContinuumIO/blaze","homepage":"blaze.pydata.org","size":17914,"stargazers_count":758,"watchers_count":758,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":76,"mirror_url":null,"open_issues_count":46,"forks":76,"open_issues":46,"watchers":758,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ContinuumIO/blaze/pulls/337"},"html":{"href":"https://github.com/ContinuumIO/blaze/pull/337"},"issue":{"href":"https://api.github.com/repos/ContinuumIO/blaze/issues/337"},"comments":{"href":"https://api.github.com/repos/ContinuumIO/blaze/issues/337/comments"},"review_comments":{"href":"https://api.github.com/repos/ContinuumIO/blaze/pulls/337/comments"},"review_comment":{"href":"https://api.github.com/repos/ContinuumIO/blaze/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ContinuumIO/blaze/pulls/337/commits"},"statuses":{"href":"https://api.github.com/repos/ContinuumIO/blaze/statuses/dbc202c6b524a39b34c04b3176a849bb1e616836"}}}}