{"action":"created","comment":{"url":"https://api.github.com/repos/assembl/assembl/pulls/comments/183070792","pull_request_review_id":114002897,"id":183070792,"diff_hunk":"@@ -279,54 +281,55 @@ def get_time_series_analytics(request):\n         # The members (can go up and down...)  Assumes that first_subscribed is available\n         memberAgentStatus = aliased(AgentStatusInDiscussion)\n         members_subquery = discussion.db.query(intervals_table.c.interval_id,\n-            func.count(memberAgentStatus.id).label('count_approximate_members')\n-            )\n-        members_subquery = members_subquery.outerjoin(memberAgentStatus, ((memberAgentStatus.last_unsubscribed >= intervals_table.c.interval_end) | (memberAgentStatus.last_unsubscribed.is_(None))) & ((memberAgentStatus.first_subscribed < intervals_table.c.interval_end) | (memberAgentStatus.first_subscribed.is_(None))) & (memberAgentStatus.discussion_id==discussion.id))\n+                                               func.count(memberAgentStatus.id).label('count_approximate_members')\n+                                               )\n+        members_subquery = members_subquery.outerjoin(memberAgentStatus, ((memberAgentStatus.last_unsubscribed >= intervals_table.c.interval_end) | (memberAgentStatus.last_unsubscribed.is_(\n+            None))) & ((memberAgentStatus.first_subscribed < intervals_table.c.interval_end) | (memberAgentStatus.first_subscribed.is_(None))) & (memberAgentStatus.discussion_id == discussion.id))\n         members_subquery = members_subquery.group_by(intervals_table.c.interval_id)\n         members_subquery = members_subquery.subquery()\n \n         subscribersAgentStatus = aliased(AgentStatusInDiscussion)\n         subscribers_query = discussion.db.query(intervals_table.c.interval_id,\n-            func.sum(\n-                case([\n-                      (subscribersAgentStatus.last_visit == None, 0),\n-                      (and_(subscribersAgentStatus.last_visit < intervals_table.c.interval_end,\n-                        subscribersAgentStatus.last_visit >= intervals_table.c.interval_start), 1)\n-                      ], else_=0)\n-                     ).label('retention_count_last_visit_in_period'),\n-            func.sum(\n-                case([\n-                      (subscribersAgentStatus.first_visit == None, 0),\n-                      (and_(subscribersAgentStatus.first_visit < intervals_table.c.interval_end,\n-                        subscribersAgentStatus.first_visit >= intervals_table.c.interval_start), 1)\n-                      ], else_=0)\n-                     ).label('recruitment_count_first_visit_in_period'),\n-            func.sum(\n-                case([\n-                      (subscribersAgentStatus.first_subscribed == None, 0),\n-                      (and_(subscribersAgentStatus.first_subscribed < intervals_table.c.interval_end,\n-                        subscribersAgentStatus.first_subscribed >= intervals_table.c.interval_start), 1)\n-                      ], else_=0)\n-                     ).label('recruitment_count_first_subscribed_in_period'),\n-            func.sum(\n-                case([\n-                      (subscribersAgentStatus.last_unsubscribed == None, 0),\n-                      (and_(subscribersAgentStatus.last_unsubscribed < intervals_table.c.interval_end,\n-                        subscribersAgentStatus.last_unsubscribed >= intervals_table.c.interval_start), 1)\n-                      ], else_=0)\n-                     ).label('retention_count_last_unsubscribed_in_period'),\n-        )\n-        subscribers_query = subscribers_query.outerjoin(subscribersAgentStatus, subscribersAgentStatus.discussion_id==discussion.id)\n+                                                func.sum(\n+                                                    case([\n+                                                        (subscribersAgentStatus.last_visit == None, 0),\n+                                                        (and_(subscribersAgentStatus.last_visit < intervals_table.c.interval_end,\n+                                                              subscribersAgentStatus.last_visit >= intervals_table.c.interval_start), 1)\n+                                                    ], else_=0)\n+                                                ).label('retention_count_last_visit_in_period'),\n+                                                func.sum(\n+                                                    case([\n+                                                        (subscribersAgentStatus.first_visit == None, 0),\n+                                                        (and_(subscribersAgentStatus.first_visit < intervals_table.c.interval_end,\n+                                                              subscribersAgentStatus.first_visit >= intervals_table.c.interval_start), 1)\n+                                                    ], else_=0)\n+                                                ).label('recruitment_count_first_visit_in_period'),\n+                                                func.sum(\n+                                                    case([","path":"assembl/views/api2/discussion.py","position":184,"original_position":184,"commit_id":"aa43817a2a5c07234595c4b499bc8d0267a8e41a","original_commit_id":"aa43817a2a5c07234595c4b499bc8d0267a8e41a","user":{"login":"mohamedzayed92","id":33838666,"avatar_url":"https://avatars2.githubusercontent.com/u/33838666?v=4","gravatar_id":"","url":"https://api.github.com/users/mohamedzayed92","html_url":"https://github.com/mohamedzayed92","followers_url":"https://api.github.com/users/mohamedzayed92/followers","following_url":"https://api.github.com/users/mohamedzayed92/following{/other_user}","gists_url":"https://api.github.com/users/mohamedzayed92/gists{/gist_id}","starred_url":"https://api.github.com/users/mohamedzayed92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohamedzayed92/subscriptions","organizations_url":"https://api.github.com/users/mohamedzayed92/orgs","repos_url":"https://api.github.com/users/mohamedzayed92/repos","events_url":"https://api.github.com/users/mohamedzayed92/events{/privacy}","received_events_url":"https://api.github.com/users/mohamedzayed92/received_events","type":"User","site_admin":false},"body":"sorry about that","created_at":"2018-04-20T14:36:07Z","updated_at":"2018-04-20T14:36:07Z","html_url":"https://github.com/assembl/assembl/pull/406#discussion_r183070792","pull_request_url":"https://api.github.com/repos/assembl/assembl/pulls/406","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/assembl/assembl/pulls/comments/183070792"},"html":{"href":"https://github.com/assembl/assembl/pull/406#discussion_r183070792"},"pull_request":{"href":"https://api.github.com/repos/assembl/assembl/pulls/406"}},"in_reply_to_id":183056897},"pull_request":{"url":"https://api.github.com/repos/assembl/assembl/pulls/406","id":181829640,"html_url":"https://github.com/assembl/assembl/pull/406","diff_url":"https://github.com/assembl/assembl/pull/406.diff","patch_url":"https://github.com/assembl/assembl/pull/406.patch","issue_url":"https://api.github.com/repos/assembl/assembl/issues/406","number":406,"state":"open","locked":false,"title":"Extract taxonomy csv","user":{"login":"mohamedzayed92","id":33838666,"avatar_url":"https://avatars2.githubusercontent.com/u/33838666?v=4","gravatar_id":"","url":"https://api.github.com/users/mohamedzayed92","html_url":"https://github.com/mohamedzayed92","followers_url":"https://api.github.com/users/mohamedzayed92/followers","following_url":"https://api.github.com/users/mohamedzayed92/following{/other_user}","gists_url":"https://api.github.com/users/mohamedzayed92/gists{/gist_id}","starred_url":"https://api.github.com/users/mohamedzayed92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohamedzayed92/subscriptions","organizations_url":"https://api.github.com/users/mohamedzayed92/orgs","repos_url":"https://api.github.com/users/mohamedzayed92/repos","events_url":"https://api.github.com/users/mohamedzayed92/events{/privacy}","received_events_url":"https://api.github.com/users/mohamedzayed92/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-16T11:24:00Z","updated_at":"2018-04-20T14:36:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3c939e78156f5d14fa900a830b83dbb1082d10fd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/assembl/assembl/pulls/406/commits","review_comments_url":"https://api.github.com/repos/assembl/assembl/pulls/406/comments","review_comment_url":"https://api.github.com/repos/assembl/assembl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/assembl/assembl/issues/406/comments","statuses_url":"https://api.github.com/repos/assembl/assembl/statuses/aa43817a2a5c07234595c4b499bc8d0267a8e41a","head":{"label":"assembl:taxonomie_part_4_DEVAS_1247","ref":"taxonomie_part_4_DEVAS_1247","sha":"aa43817a2a5c07234595c4b499bc8d0267a8e41a","user":{"login":"assembl","id":20449542,"avatar_url":"https://avatars3.githubusercontent.com/u/20449542?v=4","gravatar_id":"","url":"https://api.github.com/users/assembl","html_url":"https://github.com/assembl","followers_url":"https://api.github.com/users/assembl/followers","following_url":"https://api.github.com/users/assembl/following{/other_user}","gists_url":"https://api.github.com/users/assembl/gists{/gist_id}","starred_url":"https://api.github.com/users/assembl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/assembl/subscriptions","organizations_url":"https://api.github.com/users/assembl/orgs","repos_url":"https://api.github.com/users/assembl/repos","events_url":"https://api.github.com/users/assembl/events{/privacy}","received_events_url":"https://api.github.com/users/assembl/received_events","type":"Organization","site_admin":false},"repo":{"id":18962634,"name":"assembl","full_name":"assembl/assembl","owner":{"login":"assembl","id":20449542,"avatar_url":"https://avatars3.githubusercontent.com/u/20449542?v=4","gravatar_id":"","url":"https://api.github.com/users/assembl","html_url":"https://github.com/assembl","followers_url":"https://api.github.com/users/assembl/followers","following_url":"https://api.github.com/users/assembl/following{/other_user}","gists_url":"https://api.github.com/users/assembl/gists{/gist_id}","starred_url":"https://api.github.com/users/assembl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/assembl/subscriptions","organizations_url":"https://api.github.com/users/assembl/orgs","repos_url":"https://api.github.com/users/assembl/repos","events_url":"https://api.github.com/users/assembl/events{/privacy}","received_events_url":"https://api.github.com/users/assembl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/assembl/assembl","description":"Assembl is an online debate and synthesis platform","fork":false,"url":"https://api.github.com/repos/assembl/assembl","forks_url":"https://api.github.com/repos/assembl/assembl/forks","keys_url":"https://api.github.com/repos/assembl/assembl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/assembl/assembl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/assembl/assembl/teams","hooks_url":"https://api.github.com/repos/assembl/assembl/hooks","issue_events_url":"https://api.github.com/repos/assembl/assembl/issues/events{/number}","events_url":"https://api.github.com/repos/assembl/assembl/events","assignees_url":"https://api.github.com/repos/assembl/assembl/assignees{/user}","branches_url":"https://api.github.com/repos/assembl/assembl/branches{/branch}","tags_url":"https://api.github.com/repos/assembl/assembl/tags","blobs_url":"https://api.github.com/repos/assembl/assembl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/assembl/assembl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/assembl/assembl/git/refs{/sha}","trees_url":"https://api.github.com/repos/assembl/assembl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/assembl/assembl/statuses/{sha}","languages_url":"https://api.github.com/repos/assembl/assembl/languages","stargazers_url":"https://api.github.com/repos/assembl/assembl/stargazers","contributors_url":"https://api.github.com/repos/assembl/assembl/contributors","subscribers_url":"https://api.github.com/repos/assembl/assembl/subscribers","subscription_url":"https://api.github.com/repos/assembl/assembl/subscription","commits_url":"https://api.github.com/repos/assembl/assembl/commits{/sha}","git_commits_url":"https://api.github.com/repos/assembl/assembl/git/commits{/sha}","comments_url":"https://api.github.com/repos/assembl/assembl/comments{/number}","issue_comment_url":"https://api.github.com/repos/assembl/assembl/issues/comments{/number}","contents_url":"https://api.github.com/repos/assembl/assembl/contents/{+path}","compare_url":"https://api.github.com/repos/assembl/assembl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/assembl/assembl/merges","archive_url":"https://api.github.com/repos/assembl/assembl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/assembl/assembl/downloads","issues_url":"https://api.github.com/repos/assembl/assembl/issues{/number}","pulls_url":"https://api.github.com/repos/assembl/assembl/pulls{/number}","milestones_url":"https://api.github.com/repos/assembl/assembl/milestones{/number}","notifications_url":"https://api.github.com/repos/assembl/assembl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/assembl/assembl/labels{/name}","releases_url":"https://api.github.com/repos/assembl/assembl/releases{/id}","deployments_url":"https://api.github.com/repos/assembl/assembl/deployments","created_at":"2014-04-20T10:52:11Z","updated_at":"2018-04-20T08:46:13Z","pushed_at":"2018-04-20T13:53:25Z","git_url":"git://github.com/assembl/assembl.git","ssh_url":"git@github.com:assembl/assembl.git","clone_url":"https://github.com/assembl/assembl.git","svn_url":"https://github.com/assembl/assembl","homepage":"http://assembl.bluenove.com","size":72268,"stargazers_count":81,"watchers_count":81,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":29,"open_issues":25,"watchers":81,"default_branch":"develop"}},"base":{"label":"assembl:develop","ref":"develop","sha":"b73928213538626593f8017044f23bf1b1a8660f","user":{"login":"assembl","id":20449542,"avatar_url":"https://avatars3.githubusercontent.com/u/20449542?v=4","gravatar_id":"","url":"https://api.github.com/users/assembl","html_url":"https://github.com/assembl","followers_url":"https://api.github.com/users/assembl/followers","following_url":"https://api.github.com/users/assembl/following{/other_user}","gists_url":"https://api.github.com/users/assembl/gists{/gist_id}","starred_url":"https://api.github.com/users/assembl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/assembl/subscriptions","organizations_url":"https://api.github.com/users/assembl/orgs","repos_url":"https://api.github.com/users/assembl/repos","events_url":"https://api.github.com/users/assembl/events{/privacy}","received_events_url":"https://api.github.com/users/assembl/received_events","type":"Organization","site_admin":false},"repo":{"id":18962634,"name":"assembl","full_name":"assembl/assembl","owner":{"login":"assembl","id":20449542,"avatar_url":"https://avatars3.githubusercontent.com/u/20449542?v=4","gravatar_id":"","url":"https://api.github.com/users/assembl","html_url":"https://github.com/assembl","followers_url":"https://api.github.com/users/assembl/followers","following_url":"https://api.github.com/users/assembl/following{/other_user}","gists_url":"https://api.github.com/users/assembl/gists{/gist_id}","starred_url":"https://api.github.com/users/assembl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/assembl/subscriptions","organizations_url":"https://api.github.com/users/assembl/orgs","repos_url":"https://api.github.com/users/assembl/repos","events_url":"https://api.github.com/users/assembl/events{/privacy}","received_events_url":"https://api.github.com/users/assembl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/assembl/assembl","description":"Assembl is an online debate and synthesis platform","fork":false,"url":"https://api.github.com/repos/assembl/assembl","forks_url":"https://api.github.com/repos/assembl/assembl/forks","keys_url":"https://api.github.com/repos/assembl/assembl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/assembl/assembl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/assembl/assembl/teams","hooks_url":"https://api.github.com/repos/assembl/assembl/hooks","issue_events_url":"https://api.github.com/repos/assembl/assembl/issues/events{/number}","events_url":"https://api.github.com/repos/assembl/assembl/events","assignees_url":"https://api.github.com/repos/assembl/assembl/assignees{/user}","branches_url":"https://api.github.com/repos/assembl/assembl/branches{/branch}","tags_url":"https://api.github.com/repos/assembl/assembl/tags","blobs_url":"https://api.github.com/repos/assembl/assembl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/assembl/assembl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/assembl/assembl/git/refs{/sha}","trees_url":"https://api.github.com/repos/assembl/assembl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/assembl/assembl/statuses/{sha}","languages_url":"https://api.github.com/repos/assembl/assembl/languages","stargazers_url":"https://api.github.com/repos/assembl/assembl/stargazers","contributors_url":"https://api.github.com/repos/assembl/assembl/contributors","subscribers_url":"https://api.github.com/repos/assembl/assembl/subscribers","subscription_url":"https://api.github.com/repos/assembl/assembl/subscription","commits_url":"https://api.github.com/repos/assembl/assembl/commits{/sha}","git_commits_url":"https://api.github.com/repos/assembl/assembl/git/commits{/sha}","comments_url":"https://api.github.com/repos/assembl/assembl/comments{/number}","issue_comment_url":"https://api.github.com/repos/assembl/assembl/issues/comments{/number}","contents_url":"https://api.github.com/repos/assembl/assembl/contents/{+path}","compare_url":"https://api.github.com/repos/assembl/assembl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/assembl/assembl/merges","archive_url":"https://api.github.com/repos/assembl/assembl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/assembl/assembl/downloads","issues_url":"https://api.github.com/repos/assembl/assembl/issues{/number}","pulls_url":"https://api.github.com/repos/assembl/assembl/pulls{/number}","milestones_url":"https://api.github.com/repos/assembl/assembl/milestones{/number}","notifications_url":"https://api.github.com/repos/assembl/assembl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/assembl/assembl/labels{/name}","releases_url":"https://api.github.com/repos/assembl/assembl/releases{/id}","deployments_url":"https://api.github.com/repos/assembl/assembl/deployments","created_at":"2014-04-20T10:52:11Z","updated_at":"2018-04-20T08:46:13Z","pushed_at":"2018-04-20T13:53:25Z","git_url":"git://github.com/assembl/assembl.git","ssh_url":"git@github.com:assembl/assembl.git","clone_url":"https://github.com/assembl/assembl.git","svn_url":"https://github.com/assembl/assembl","homepage":"http://assembl.bluenove.com","size":72268,"stargazers_count":81,"watchers_count":81,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":29,"open_issues":25,"watchers":81,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/assembl/assembl/pulls/406"},"html":{"href":"https://github.com/assembl/assembl/pull/406"},"issue":{"href":"https://api.github.com/repos/assembl/assembl/issues/406"},"comments":{"href":"https://api.github.com/repos/assembl/assembl/issues/406/comments"},"review_comments":{"href":"https://api.github.com/repos/assembl/assembl/pulls/406/comments"},"review_comment":{"href":"https://api.github.com/repos/assembl/assembl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/assembl/assembl/pulls/406/commits"},"statuses":{"href":"https://api.github.com/repos/assembl/assembl/statuses/aa43817a2a5c07234595c4b499bc8d0267a8e41a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mohamedzayed92"}}