{"action":"created","comment":{"url":"https://api.github.com/repos/hammerlab/cycledash/pulls/comments/25648827","id":25648827,"diff_hunk":"@@ -274,18 +274,16 @@ def _add_filter(sql_query, table, column_name, column_type, value, op_name):\n     col = column(column_name)\n     if table.c.get(column_name) is not None:\n         col = cast(table.c[column_name], sqla_type)\n-    return {\n-        '=': sql_query.where(col == value),\n-        '!=': sql_query.where(col != value),\n-        '<': sql_query.where(col < value),\n-        '>': sql_query.where(col > value),\n-        '>=': sql_query.where(col >= value),\n-        '<=': sql_query.where(col <= value),\n-        'NULL': sql_query.where(col != None),\n-        'NOT NULL': sql_query.where(col == None),\n-        'LIKE': sql_query.where(col.like(value)),\n-        'RLIKE': sql_query.where(col.op('~*')(value))\n-    }.get(op_name)\n+    if op_name == '=':    return sql_query.where(col == value)\n+    elif op_name == '!=': return sql_query.where(col != value)\n+    elif op_name == '<':  return sql_query.where(col < value)\n+    elif op_name == '>':  return sql_query.where(col > value)\n+    elif op_name == '>=': return sql_query.where(col >= value)\n+    elif op_name == '<=': return sql_query.where(col <= value)\n+    elif op_name == 'NULL': return sql_query.where(col == None)\n+    elif op_name == 'NOT NULL': return sql_query.where(col != None)\n+    elif op_name == 'LIKE': return sql_query.where(col.like(value))\n+    elif op_name == 'RLIKE': return sql_query.where(col.op('~*')(value))","path":"cycledash/genotypes.py","position":25,"original_position":25,"commit_id":"30cea65743faeef13730dfe515bd5a97922e2c59","original_commit_id":"30cea65743faeef13730dfe515bd5a97922e2c59","user":{"login":"danvk","id":98301,"avatar_url":"https://avatars.githubusercontent.com/u/98301?v=3","gravatar_id":"","url":"https://api.github.com/users/danvk","html_url":"https://github.com/danvk","followers_url":"https://api.github.com/users/danvk/followers","following_url":"https://api.github.com/users/danvk/following{/other_user}","gists_url":"https://api.github.com/users/danvk/gists{/gist_id}","starred_url":"https://api.github.com/users/danvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danvk/subscriptions","organizations_url":"https://api.github.com/users/danvk/orgs","repos_url":"https://api.github.com/users/danvk/repos","events_url":"https://api.github.com/users/danvk/events{/privacy}","received_events_url":"https://api.github.com/users/danvk/received_events","type":"User","site_admin":false},"body":"_add_filter constructed all possible operators, then threw all but one away. This wouldn't work for null checks, since x > NULL is invalid SQL.","created_at":"2015-03-02T23:18:10Z","updated_at":"2015-03-02T23:18:10Z","html_url":"https://github.com/hammerlab/cycledash/pull/497#discussion_r25648827","pull_request_url":"https://api.github.com/repos/hammerlab/cycledash/pulls/497","_links":{"self":{"href":"https://api.github.com/repos/hammerlab/cycledash/pulls/comments/25648827"},"html":{"href":"https://github.com/hammerlab/cycledash/pull/497#discussion_r25648827"},"pull_request":{"href":"https://api.github.com/repos/hammerlab/cycledash/pulls/497"}}},"pull_request":{"url":"https://api.github.com/repos/hammerlab/cycledash/pulls/497","id":30322277,"html_url":"https://github.com/hammerlab/cycledash/pull/497","diff_url":"https://github.com/hammerlab/cycledash/pull/497.diff","patch_url":"https://github.com/hammerlab/cycledash/pull/497.patch","issue_url":"https://api.github.com/repos/hammerlab/cycledash/issues/497","number":497,"state":"open","locked":false,"title":"Put CQL queries in the URL, not JSON","user":{"login":"danvk","id":98301,"avatar_url":"https://avatars.githubusercontent.com/u/98301?v=3","gravatar_id":"","url":"https://api.github.com/users/danvk","html_url":"https://github.com/danvk","followers_url":"https://api.github.com/users/danvk/followers","following_url":"https://api.github.com/users/danvk/following{/other_user}","gists_url":"https://api.github.com/users/danvk/gists{/gist_id}","starred_url":"https://api.github.com/users/danvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danvk/subscriptions","organizations_url":"https://api.github.com/users/danvk/orgs","repos_url":"https://api.github.com/users/danvk/repos","events_url":"https://api.github.com/users/danvk/events{/privacy}","received_events_url":"https://api.github.com/users/danvk/received_events","type":"User","site_admin":false},"body":"This results in much cleaner URLs (see `test.yaml` for before/after).\r\n\r\nThis also fixes a few scary bugs:\r\n\r\n- `get_all_comments` always returned `None`\r\n- The behavior of `NULL` and `NOT NULL` was reversed.\r\n- `_add_filter` constructed all possible operators, then threw all but one away. This wouldn't work for null checks, since `x > NULL` is invalid SQL.\r\n- `toString()` was broken for queries involving null checks\r\n\r\nOne thing to note: this parses the query and then sets the URL parameter by re-serializing it to CQL. A simpler approach might be to store the raw CQL query in the URL box, but this would involve threading that through the `RecordStore`. I'm open to suggestions.\r\n\r\nFixes #495 \r\nFixes #304 \n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/hammerlab/cycledash/497)\n<!-- Reviewable:end -->\n","created_at":"2015-03-02T21:27:33Z","updated_at":"2015-03-02T23:18:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c55ca92e5ff1dd582ff4b39b4219a433f0c4d1e9","assignee":{"login":"ihodes","id":167803,"avatar_url":"https://avatars.githubusercontent.com/u/167803?v=3","gravatar_id":"","url":"https://api.github.com/users/ihodes","html_url":"https://github.com/ihodes","followers_url":"https://api.github.com/users/ihodes/followers","following_url":"https://api.github.com/users/ihodes/following{/other_user}","gists_url":"https://api.github.com/users/ihodes/gists{/gist_id}","starred_url":"https://api.github.com/users/ihodes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ihodes/subscriptions","organizations_url":"https://api.github.com/users/ihodes/orgs","repos_url":"https://api.github.com/users/ihodes/repos","events_url":"https://api.github.com/users/ihodes/events{/privacy}","received_events_url":"https://api.github.com/users/ihodes/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/hammerlab/cycledash/pulls/497/commits","review_comments_url":"https://api.github.com/repos/hammerlab/cycledash/pulls/497/comments","review_comment_url":"https://api.github.com/repos/hammerlab/cycledash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hammerlab/cycledash/issues/497/comments","statuses_url":"https://api.github.com/repos/hammerlab/cycledash/statuses/30cea65743faeef13730dfe515bd5a97922e2c59","head":{"label":"hammerlab:cql-url","ref":"cql-url","sha":"30cea65743faeef13730dfe515bd5a97922e2c59","user":{"login":"hammerlab","id":6563873,"avatar_url":"https://avatars.githubusercontent.com/u/6563873?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerlab","html_url":"https://github.com/hammerlab","followers_url":"https://api.github.com/users/hammerlab/followers","following_url":"https://api.github.com/users/hammerlab/following{/other_user}","gists_url":"https://api.github.com/users/hammerlab/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerlab/subscriptions","organizations_url":"https://api.github.com/users/hammerlab/orgs","repos_url":"https://api.github.com/users/hammerlab/repos","events_url":"https://api.github.com/users/hammerlab/events{/privacy}","received_events_url":"https://api.github.com/users/hammerlab/received_events","type":"Organization","site_admin":false},"repo":{"id":20279144,"name":"cycledash","full_name":"hammerlab/cycledash","owner":{"login":"hammerlab","id":6563873,"avatar_url":"https://avatars.githubusercontent.com/u/6563873?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerlab","html_url":"https://github.com/hammerlab","followers_url":"https://api.github.com/users/hammerlab/followers","following_url":"https://api.github.com/users/hammerlab/following{/other_user}","gists_url":"https://api.github.com/users/hammerlab/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerlab/subscriptions","organizations_url":"https://api.github.com/users/hammerlab/orgs","repos_url":"https://api.github.com/users/hammerlab/repos","events_url":"https://api.github.com/users/hammerlab/events{/privacy}","received_events_url":"https://api.github.com/users/hammerlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hammerlab/cycledash","description":"Variant Caller Analysis Dashboard and Data Management System","fork":false,"url":"https://api.github.com/repos/hammerlab/cycledash","forks_url":"https://api.github.com/repos/hammerlab/cycledash/forks","keys_url":"https://api.github.com/repos/hammerlab/cycledash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hammerlab/cycledash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hammerlab/cycledash/teams","hooks_url":"https://api.github.com/repos/hammerlab/cycledash/hooks","issue_events_url":"https://api.github.com/repos/hammerlab/cycledash/issues/events{/number}","events_url":"https://api.github.com/repos/hammerlab/cycledash/events","assignees_url":"https://api.github.com/repos/hammerlab/cycledash/assignees{/user}","branches_url":"https://api.github.com/repos/hammerlab/cycledash/branches{/branch}","tags_url":"https://api.github.com/repos/hammerlab/cycledash/tags","blobs_url":"https://api.github.com/repos/hammerlab/cycledash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hammerlab/cycledash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hammerlab/cycledash/git/refs{/sha}","trees_url":"https://api.github.com/repos/hammerlab/cycledash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hammerlab/cycledash/statuses/{sha}","languages_url":"https://api.github.com/repos/hammerlab/cycledash/languages","stargazers_url":"https://api.github.com/repos/hammerlab/cycledash/stargazers","contributors_url":"https://api.github.com/repos/hammerlab/cycledash/contributors","subscribers_url":"https://api.github.com/repos/hammerlab/cycledash/subscribers","subscription_url":"https://api.github.com/repos/hammerlab/cycledash/subscription","commits_url":"https://api.github.com/repos/hammerlab/cycledash/commits{/sha}","git_commits_url":"https://api.github.com/repos/hammerlab/cycledash/git/commits{/sha}","comments_url":"https://api.github.com/repos/hammerlab/cycledash/comments{/number}","issue_comment_url":"https://api.github.com/repos/hammerlab/cycledash/issues/comments{/number}","contents_url":"https://api.github.com/repos/hammerlab/cycledash/contents/{+path}","compare_url":"https://api.github.com/repos/hammerlab/cycledash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hammerlab/cycledash/merges","archive_url":"https://api.github.com/repos/hammerlab/cycledash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hammerlab/cycledash/downloads","issues_url":"https://api.github.com/repos/hammerlab/cycledash/issues{/number}","pulls_url":"https://api.github.com/repos/hammerlab/cycledash/pulls{/number}","milestones_url":"https://api.github.com/repos/hammerlab/cycledash/milestones{/number}","notifications_url":"https://api.github.com/repos/hammerlab/cycledash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hammerlab/cycledash/labels{/name}","releases_url":"https://api.github.com/repos/hammerlab/cycledash/releases{/id}","created_at":"2014-05-29T01:58:41Z","updated_at":"2015-03-02T22:59:36Z","pushed_at":"2015-03-02T22:59:36Z","git_url":"git://github.com/hammerlab/cycledash.git","ssh_url":"git@github.com:hammerlab/cycledash.git","clone_url":"https://github.com/hammerlab/cycledash.git","svn_url":"https://github.com/hammerlab/cycledash","homepage":null,"size":27428,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":126,"forks":0,"open_issues":126,"watchers":14,"default_branch":"master"}},"base":{"label":"hammerlab:master","ref":"master","sha":"a0936dc0037d528eef104b61656f34fc39f45a7b","user":{"login":"hammerlab","id":6563873,"avatar_url":"https://avatars.githubusercontent.com/u/6563873?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerlab","html_url":"https://github.com/hammerlab","followers_url":"https://api.github.com/users/hammerlab/followers","following_url":"https://api.github.com/users/hammerlab/following{/other_user}","gists_url":"https://api.github.com/users/hammerlab/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerlab/subscriptions","organizations_url":"https://api.github.com/users/hammerlab/orgs","repos_url":"https://api.github.com/users/hammerlab/repos","events_url":"https://api.github.com/users/hammerlab/events{/privacy}","received_events_url":"https://api.github.com/users/hammerlab/received_events","type":"Organization","site_admin":false},"repo":{"id":20279144,"name":"cycledash","full_name":"hammerlab/cycledash","owner":{"login":"hammerlab","id":6563873,"avatar_url":"https://avatars.githubusercontent.com/u/6563873?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerlab","html_url":"https://github.com/hammerlab","followers_url":"https://api.github.com/users/hammerlab/followers","following_url":"https://api.github.com/users/hammerlab/following{/other_user}","gists_url":"https://api.github.com/users/hammerlab/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerlab/subscriptions","organizations_url":"https://api.github.com/users/hammerlab/orgs","repos_url":"https://api.github.com/users/hammerlab/repos","events_url":"https://api.github.com/users/hammerlab/events{/privacy}","received_events_url":"https://api.github.com/users/hammerlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hammerlab/cycledash","description":"Variant Caller Analysis Dashboard and Data Management System","fork":false,"url":"https://api.github.com/repos/hammerlab/cycledash","forks_url":"https://api.github.com/repos/hammerlab/cycledash/forks","keys_url":"https://api.github.com/repos/hammerlab/cycledash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hammerlab/cycledash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hammerlab/cycledash/teams","hooks_url":"https://api.github.com/repos/hammerlab/cycledash/hooks","issue_events_url":"https://api.github.com/repos/hammerlab/cycledash/issues/events{/number}","events_url":"https://api.github.com/repos/hammerlab/cycledash/events","assignees_url":"https://api.github.com/repos/hammerlab/cycledash/assignees{/user}","branches_url":"https://api.github.com/repos/hammerlab/cycledash/branches{/branch}","tags_url":"https://api.github.com/repos/hammerlab/cycledash/tags","blobs_url":"https://api.github.com/repos/hammerlab/cycledash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hammerlab/cycledash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hammerlab/cycledash/git/refs{/sha}","trees_url":"https://api.github.com/repos/hammerlab/cycledash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hammerlab/cycledash/statuses/{sha}","languages_url":"https://api.github.com/repos/hammerlab/cycledash/languages","stargazers_url":"https://api.github.com/repos/hammerlab/cycledash/stargazers","contributors_url":"https://api.github.com/repos/hammerlab/cycledash/contributors","subscribers_url":"https://api.github.com/repos/hammerlab/cycledash/subscribers","subscription_url":"https://api.github.com/repos/hammerlab/cycledash/subscription","commits_url":"https://api.github.com/repos/hammerlab/cycledash/commits{/sha}","git_commits_url":"https://api.github.com/repos/hammerlab/cycledash/git/commits{/sha}","comments_url":"https://api.github.com/repos/hammerlab/cycledash/comments{/number}","issue_comment_url":"https://api.github.com/repos/hammerlab/cycledash/issues/comments{/number}","contents_url":"https://api.github.com/repos/hammerlab/cycledash/contents/{+path}","compare_url":"https://api.github.com/repos/hammerlab/cycledash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hammerlab/cycledash/merges","archive_url":"https://api.github.com/repos/hammerlab/cycledash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hammerlab/cycledash/downloads","issues_url":"https://api.github.com/repos/hammerlab/cycledash/issues{/number}","pulls_url":"https://api.github.com/repos/hammerlab/cycledash/pulls{/number}","milestones_url":"https://api.github.com/repos/hammerlab/cycledash/milestones{/number}","notifications_url":"https://api.github.com/repos/hammerlab/cycledash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hammerlab/cycledash/labels{/name}","releases_url":"https://api.github.com/repos/hammerlab/cycledash/releases{/id}","created_at":"2014-05-29T01:58:41Z","updated_at":"2015-03-02T22:59:36Z","pushed_at":"2015-03-02T22:59:36Z","git_url":"git://github.com/hammerlab/cycledash.git","ssh_url":"git@github.com:hammerlab/cycledash.git","clone_url":"https://github.com/hammerlab/cycledash.git","svn_url":"https://github.com/hammerlab/cycledash","homepage":null,"size":27428,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":126,"forks":0,"open_issues":126,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hammerlab/cycledash/pulls/497"},"html":{"href":"https://github.com/hammerlab/cycledash/pull/497"},"issue":{"href":"https://api.github.com/repos/hammerlab/cycledash/issues/497"},"comments":{"href":"https://api.github.com/repos/hammerlab/cycledash/issues/497/comments"},"review_comments":{"href":"https://api.github.com/repos/hammerlab/cycledash/pulls/497/comments"},"review_comment":{"href":"https://api.github.com/repos/hammerlab/cycledash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hammerlab/cycledash/pulls/497/commits"},"statuses":{"href":"https://api.github.com/repos/hammerlab/cycledash/statuses/30cea65743faeef13730dfe515bd5a97922e2c59"}}}}