{"action":"created","comment":{"url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls/comments/209569595","pull_request_review_id":145605751,"id":209569595,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTU2OTU5NQ==","diff_hunk":"@@ -205,6 +225,21 @@ def __str__(self):\n             percent=self.percent,\n         )\n \n+    def get_values(self):\n+        \"\"\"\n+        Return a dict object containing fields and their values to be used in bulk create or update query.\n+        \"\"\"\n+        # these keys values will be assigned as it is\n+        exact_keys = ['user', 'course_key', 'block_key', 'aggregation_name', 'earned', 'possible', 'last_modified']\n+        values = {}","path":"completion_aggregator/models.py","position":71,"original_position":71,"commit_id":"d89d9251cd583415d4726972832850e8fd1f962a","original_commit_id":"d89d9251cd583415d4726972832850e8fd1f962a","user":{"login":"symbolist","id":5305552,"node_id":"MDQ6VXNlcjUzMDU1NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/5305552?v=4","gravatar_id":"","url":"https://api.github.com/users/symbolist","html_url":"https://github.com/symbolist","followers_url":"https://api.github.com/users/symbolist/followers","following_url":"https://api.github.com/users/symbolist/following{/other_user}","gists_url":"https://api.github.com/users/symbolist/gists{/gist_id}","starred_url":"https://api.github.com/users/symbolist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symbolist/subscriptions","organizations_url":"https://api.github.com/users/symbolist/orgs","repos_url":"https://api.github.com/users/symbolist/repos","events_url":"https://api.github.com/users/symbolist/events{/privacy}","received_events_url":"https://api.github.com/users/symbolist/received_events","type":"User","site_admin":false},"body":"I meant this is not needed since it is being set in the next line.","created_at":"2018-08-13T11:05:37Z","updated_at":"2018-08-13T11:05:37Z","html_url":"https://github.com/open-craft/openedx-completion-aggregator/pull/21#discussion_r209569595","pull_request_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls/21","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls/comments/209569595"},"html":{"href":"https://github.com/open-craft/openedx-completion-aggregator/pull/21#discussion_r209569595"},"pull_request":{"href":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls/21"}},"in_reply_to_id":209542042},"pull_request":{"url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls/21","id":206941606,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2OTQxNjA2","html_url":"https://github.com/open-craft/openedx-completion-aggregator/pull/21","diff_url":"https://github.com/open-craft/openedx-completion-aggregator/pull/21.diff","patch_url":"https://github.com/open-craft/openedx-completion-aggregator/pull/21.patch","issue_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/issues/21","number":21,"state":"open","locked":false,"title":"Use mysql on insert duplicate update query to reduce number of aggregation query per course.","user":{"login":"taranjeet","id":4302268,"node_id":"MDQ6VXNlcjQzMDIyNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/4302268?v=4","gravatar_id":"","url":"https://api.github.com/users/taranjeet","html_url":"https://github.com/taranjeet","followers_url":"https://api.github.com/users/taranjeet/followers","following_url":"https://api.github.com/users/taranjeet/following{/other_user}","gists_url":"https://api.github.com/users/taranjeet/gists{/gist_id}","starred_url":"https://api.github.com/users/taranjeet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taranjeet/subscriptions","organizations_url":"https://api.github.com/users/taranjeet/orgs","repos_url":"https://api.github.com/users/taranjeet/repos","events_url":"https://api.github.com/users/taranjeet/events{/privacy}","received_events_url":"https://api.github.com/users/taranjeet/received_events","type":"User","site_admin":false},"body":"\r\n**Description:** \r\n\r\nThis PR adds support to reduce the number of queries made to insert aggregation data per course. It uses Mysql Insert on Duplicate Update query, so that a single query can be sent which contains manyu rows of aggregation data\r\n\r\n**JIRA:** [OC-4844](https://tasks.opencraft.com/browse/OC-4844)\r\n\r\n**Dependencies:** NA\r\n\r\n**Merge deadline:** List merge deadline (if any)\r\n\r\n**Installation instructions:** List any non-trivial installation \r\ninstructions.\r\n\r\n**Testing instructions:**\r\n\r\nTests should pass\r\n\r\n**Reviewers:**\r\n- [ ] @symbolist \r\n- [ ] @jcdyer \r\n\r\n**Merge checklist:**\r\n- [ ] All reviewers approved\r\n- [ ] CI build is green\r\n- [ ] Version bumped\r\n- [ ] Changelog record added\r\n- [ ] Documentation updated (not only docstrings)\r\n- [ ] Commits are squashed\r\n- [ ] PR author is listed in AUTHORS\r\n\r\n**Post merge:**\r\n- [ ] Create a tag\r\n- [ ] Check new version is pushed to PyPI after tag-triggered build is \r\n      finished.\r\n- [ ] Delete working branch (if not needed anymore)\r\n\r\n**Author concerns:** \r\n* Functions like `AggregatorManager.validate` and the logic to calculate percentage completion are duplicated in `AggregationUpdater._is_aggregator_data_valid` and `utils.get_percent`. I was not sure where to keep them or convert the existing method to static method or so.","created_at":"2018-08-08T09:14:45Z","updated_at":"2018-08-13T11:05:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"58a482b123ed2e420fbda2704ae4e4cf6f774d89","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls/21/commits","review_comments_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls/21/comments","review_comment_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/issues/21/comments","statuses_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/statuses/d89d9251cd583415d4726972832850e8fd1f962a","head":{"label":"open-craft:taranjeet/use-mysql-on-dup-update","ref":"taranjeet/use-mysql-on-dup-update","sha":"d89d9251cd583415d4726972832850e8fd1f962a","user":{"login":"open-craft","id":7414786,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MTQ3ODY=","avatar_url":"https://avatars0.githubusercontent.com/u/7414786?v=4","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"repo":{"id":116283379,"node_id":"MDEwOlJlcG9zaXRvcnkxMTYyODMzNzk=","name":"openedx-completion-aggregator","full_name":"open-craft/openedx-completion-aggregator","owner":{"login":"open-craft","id":7414786,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MTQ3ODY=","avatar_url":"https://avatars0.githubusercontent.com/u/7414786?v=4","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-craft/openedx-completion-aggregator","description":"An Open edX Django app that aggregates block-level completion data to report on different block types.","fork":false,"url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator","forks_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/forks","keys_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/teams","hooks_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/hooks","issue_events_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/issues/events{/number}","events_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/events","assignees_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/assignees{/user}","branches_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/branches{/branch}","tags_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/tags","blobs_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/statuses/{sha}","languages_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/languages","stargazers_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/stargazers","contributors_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/contributors","subscribers_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/subscribers","subscription_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/subscription","commits_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/contents/{+path}","compare_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/merges","archive_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/downloads","issues_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/issues{/number}","pulls_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls{/number}","milestones_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/milestones{/number}","notifications_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/labels{/name}","releases_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/releases{/id}","deployments_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/deployments","created_at":"2018-01-04T16:38:20Z","updated_at":"2018-07-27T17:15:56Z","pushed_at":"2018-08-10T19:37:38Z","git_url":"git://github.com/open-craft/openedx-completion-aggregator.git","ssh_url":"git@github.com:open-craft/openedx-completion-aggregator.git","clone_url":"https://github.com/open-craft/openedx-completion-aggregator.git","svn_url":"https://github.com/open-craft/openedx-completion-aggregator","homepage":null,"size":211,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"open-craft:master","ref":"master","sha":"f93930d169faacd5e1716e35f6f2214710679d06","user":{"login":"open-craft","id":7414786,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MTQ3ODY=","avatar_url":"https://avatars0.githubusercontent.com/u/7414786?v=4","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"repo":{"id":116283379,"node_id":"MDEwOlJlcG9zaXRvcnkxMTYyODMzNzk=","name":"openedx-completion-aggregator","full_name":"open-craft/openedx-completion-aggregator","owner":{"login":"open-craft","id":7414786,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc0MTQ3ODY=","avatar_url":"https://avatars0.githubusercontent.com/u/7414786?v=4","gravatar_id":"","url":"https://api.github.com/users/open-craft","html_url":"https://github.com/open-craft","followers_url":"https://api.github.com/users/open-craft/followers","following_url":"https://api.github.com/users/open-craft/following{/other_user}","gists_url":"https://api.github.com/users/open-craft/gists{/gist_id}","starred_url":"https://api.github.com/users/open-craft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-craft/subscriptions","organizations_url":"https://api.github.com/users/open-craft/orgs","repos_url":"https://api.github.com/users/open-craft/repos","events_url":"https://api.github.com/users/open-craft/events{/privacy}","received_events_url":"https://api.github.com/users/open-craft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-craft/openedx-completion-aggregator","description":"An Open edX Django app that aggregates block-level completion data to report on different block types.","fork":false,"url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator","forks_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/forks","keys_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/teams","hooks_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/hooks","issue_events_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/issues/events{/number}","events_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/events","assignees_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/assignees{/user}","branches_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/branches{/branch}","tags_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/tags","blobs_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/statuses/{sha}","languages_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/languages","stargazers_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/stargazers","contributors_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/contributors","subscribers_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/subscribers","subscription_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/subscription","commits_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/contents/{+path}","compare_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/merges","archive_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/downloads","issues_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/issues{/number}","pulls_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls{/number}","milestones_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/milestones{/number}","notifications_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/labels{/name}","releases_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/releases{/id}","deployments_url":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/deployments","created_at":"2018-01-04T16:38:20Z","updated_at":"2018-07-27T17:15:56Z","pushed_at":"2018-08-10T19:37:38Z","git_url":"git://github.com/open-craft/openedx-completion-aggregator.git","ssh_url":"git@github.com:open-craft/openedx-completion-aggregator.git","clone_url":"https://github.com/open-craft/openedx-completion-aggregator.git","svn_url":"https://github.com/open-craft/openedx-completion-aggregator","homepage":null,"size":211,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls/21"},"html":{"href":"https://github.com/open-craft/openedx-completion-aggregator/pull/21"},"issue":{"href":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/issues/21"},"comments":{"href":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/open-craft/openedx-completion-aggregator/statuses/d89d9251cd583415d4726972832850e8fd1f962a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"symbolist"}}