{"action":"created","comment":{"url":"https://api.github.com/repos/boto/boto/pulls/comments/23872547","id":23872547,"diff_hunk":"@@ -407,39 +412,100 @@ def update(self, throughput, global_indexes=None):\n             ...     'write': 10,\n             ... },\n             ... global_secondary_indexes={\n-            ...     'TheIndexNameHere': {\n-            ...         'read': 15,\n-            ...         'write': 5,\n-            ...     }\n+            ...     'update': {\n+            ...         'TheIndexNameHere': {\n+            ...             'read': 15,\n+            ...             'write': 5,\n+            ...         }\n+            ...      }\n+            ... })\n+\n+            # To create a global index(es)\n+            >>> users.update(global_secondary_indexes={\n+            ...     'create': {\n+            ...         GlobalAllIndex('TheIndexNameHere', parts=[\n+            ...             HashKey('requiredHashkey', data_type=STRING),\n+            ...             RangeKey('optionalRangeKey', data_type=STRING)\n+            ...         ],\n+            ...         throughput={\n+            ...             'read': 2,\n+            ...             'write': 1,\n+            ...         }),\n+            ...      }\n+            ... })\n+\n+            # To delete a global index(es)\n+            >>> users.update(global_secondary_indexes={\n+            ...     'delete': 'TheIndexNameHere'\n             ... })\n             True\n \n         \"\"\"\n-        self.throughput = throughput\n-        data = {\n-            'ReadCapacityUnits': int(self.throughput['read']),\n-            'WriteCapacityUnits': int(self.throughput['write']),\n-        }\n+\n+        data = None\n+\n+        if throughput:\n+            self.throughput = throughput\n+            data = {\n+                'ReadCapacityUnits': int(self.throughput['read']),\n+                'WriteCapacityUnits': int(self.throughput['write']),\n+            }\n+\n         gsi_data = None\n+        gsi_data_attr_def = None\n \n         if global_indexes:\n             gsi_data = []\n \n-            for gsi_name, gsi_throughput in global_indexes.items():","path":"boto/dynamodb2/table.py","position":99,"original_position":99,"commit_id":"34a515d23e1ecc6e2930ef981dcab84f0970a6c8","original_commit_id":"34a515d23e1ecc6e2930ef981dcab84f0970a6c8","user":{"login":"xethorn","id":1835927,"avatar_url":"https://avatars.githubusercontent.com/u/1835927?v=3","gravatar_id":"","url":"https://api.github.com/users/xethorn","html_url":"https://github.com/xethorn","followers_url":"https://api.github.com/users/xethorn/followers","following_url":"https://api.github.com/users/xethorn/following{/other_user}","gists_url":"https://api.github.com/users/xethorn/gists{/gist_id}","starred_url":"https://api.github.com/users/xethorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xethorn/subscriptions","organizations_url":"https://api.github.com/users/xethorn/orgs","repos_url":"https://api.github.com/users/xethorn/repos","events_url":"https://api.github.com/users/xethorn/events{/privacy}","received_events_url":"https://api.github.com/users/xethorn/received_events","type":"User","site_admin":false},"body":"this code will just end up using the new `create_global_secondary_index`","created_at":"2015-01-30T21:08:51Z","updated_at":"2015-01-30T21:08:51Z","html_url":"https://github.com/boto/boto/pull/2925#discussion_r23872547","pull_request_url":"https://api.github.com/repos/boto/boto/pulls/2925","_links":{"self":{"href":"https://api.github.com/repos/boto/boto/pulls/comments/23872547"},"html":{"href":"https://github.com/boto/boto/pull/2925#discussion_r23872547"},"pull_request":{"href":"https://api.github.com/repos/boto/boto/pulls/2925"}}},"pull_request":{"url":"https://api.github.com/repos/boto/boto/pulls/2925","id":28353272,"html_url":"https://github.com/boto/boto/pull/2925","diff_url":"https://github.com/boto/boto/pull/2925.diff","patch_url":"https://github.com/boto/boto/pull/2925.patch","issue_url":"https://api.github.com/repos/boto/boto/issues/2925","number":2925,"state":"open","locked":false,"title":"Add Amazon DynamoDB online indexing support on High level API","user":{"login":"pauloubuntu","id":1011868,"avatar_url":"https://avatars.githubusercontent.com/u/1011868?v=3","gravatar_id":"","url":"https://api.github.com/users/pauloubuntu","html_url":"https://github.com/pauloubuntu","followers_url":"https://api.github.com/users/pauloubuntu/followers","following_url":"https://api.github.com/users/pauloubuntu/following{/other_user}","gists_url":"https://api.github.com/users/pauloubuntu/gists{/gist_id}","starred_url":"https://api.github.com/users/pauloubuntu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauloubuntu/subscriptions","organizations_url":"https://api.github.com/users/pauloubuntu/orgs","repos_url":"https://api.github.com/users/pauloubuntu/repos","events_url":"https://api.github.com/users/pauloubuntu/events{/privacy}","received_events_url":"https://api.github.com/users/pauloubuntu/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nYesterday (Jan-29), Amazon has added support to add or delete global indexes at any time, which is by far the feature I was most looking forward using for over a year. \r\n\r\nI've changed dynamodb2.table.update method taking into account the backward campatibility as well. Documentation amendments and a unit test case has been provided too accordingly to the contributing guidelines.\r\n\r\nLooking forward to see this in the new version of boto. \r\n","created_at":"2015-01-30T11:01:29Z","updated_at":"2015-01-30T21:08:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a759f30be39261b585a9a156617aee62336c186b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/boto/boto/pulls/2925/commits","review_comments_url":"https://api.github.com/repos/boto/boto/pulls/2925/comments","review_comment_url":"https://api.github.com/repos/boto/boto/pulls/comments/{number}","comments_url":"https://api.github.com/repos/boto/boto/issues/2925/comments","statuses_url":"https://api.github.com/repos/boto/boto/statuses/34a515d23e1ecc6e2930ef981dcab84f0970a6c8","head":{"label":"pauloubuntu:develop","ref":"develop","sha":"34a515d23e1ecc6e2930ef981dcab84f0970a6c8","user":{"login":"pauloubuntu","id":1011868,"avatar_url":"https://avatars.githubusercontent.com/u/1011868?v=3","gravatar_id":"","url":"https://api.github.com/users/pauloubuntu","html_url":"https://github.com/pauloubuntu","followers_url":"https://api.github.com/users/pauloubuntu/followers","following_url":"https://api.github.com/users/pauloubuntu/following{/other_user}","gists_url":"https://api.github.com/users/pauloubuntu/gists{/gist_id}","starred_url":"https://api.github.com/users/pauloubuntu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauloubuntu/subscriptions","organizations_url":"https://api.github.com/users/pauloubuntu/orgs","repos_url":"https://api.github.com/users/pauloubuntu/repos","events_url":"https://api.github.com/users/pauloubuntu/events{/privacy}","received_events_url":"https://api.github.com/users/pauloubuntu/received_events","type":"User","site_admin":false},"repo":{"id":28155096,"name":"boto","full_name":"pauloubuntu/boto","owner":{"login":"pauloubuntu","id":1011868,"avatar_url":"https://avatars.githubusercontent.com/u/1011868?v=3","gravatar_id":"","url":"https://api.github.com/users/pauloubuntu","html_url":"https://github.com/pauloubuntu","followers_url":"https://api.github.com/users/pauloubuntu/followers","following_url":"https://api.github.com/users/pauloubuntu/following{/other_user}","gists_url":"https://api.github.com/users/pauloubuntu/gists{/gist_id}","starred_url":"https://api.github.com/users/pauloubuntu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pauloubuntu/subscriptions","organizations_url":"https://api.github.com/users/pauloubuntu/orgs","repos_url":"https://api.github.com/users/pauloubuntu/repos","events_url":"https://api.github.com/users/pauloubuntu/events{/privacy}","received_events_url":"https://api.github.com/users/pauloubuntu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pauloubuntu/boto","description":"Python interface to Amazon Web Services","fork":true,"url":"https://api.github.com/repos/pauloubuntu/boto","forks_url":"https://api.github.com/repos/pauloubuntu/boto/forks","keys_url":"https://api.github.com/repos/pauloubuntu/boto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pauloubuntu/boto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pauloubuntu/boto/teams","hooks_url":"https://api.github.com/repos/pauloubuntu/boto/hooks","issue_events_url":"https://api.github.com/repos/pauloubuntu/boto/issues/events{/number}","events_url":"https://api.github.com/repos/pauloubuntu/boto/events","assignees_url":"https://api.github.com/repos/pauloubuntu/boto/assignees{/user}","branches_url":"https://api.github.com/repos/pauloubuntu/boto/branches{/branch}","tags_url":"https://api.github.com/repos/pauloubuntu/boto/tags","blobs_url":"https://api.github.com/repos/pauloubuntu/boto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pauloubuntu/boto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pauloubuntu/boto/git/refs{/sha}","trees_url":"https://api.github.com/repos/pauloubuntu/boto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pauloubuntu/boto/statuses/{sha}","languages_url":"https://api.github.com/repos/pauloubuntu/boto/languages","stargazers_url":"https://api.github.com/repos/pauloubuntu/boto/stargazers","contributors_url":"https://api.github.com/repos/pauloubuntu/boto/contributors","subscribers_url":"https://api.github.com/repos/pauloubuntu/boto/subscribers","subscription_url":"https://api.github.com/repos/pauloubuntu/boto/subscription","commits_url":"https://api.github.com/repos/pauloubuntu/boto/commits{/sha}","git_commits_url":"https://api.github.com/repos/pauloubuntu/boto/git/commits{/sha}","comments_url":"https://api.github.com/repos/pauloubuntu/boto/comments{/number}","issue_comment_url":"https://api.github.com/repos/pauloubuntu/boto/issues/comments/{number}","contents_url":"https://api.github.com/repos/pauloubuntu/boto/contents/{+path}","compare_url":"https://api.github.com/repos/pauloubuntu/boto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pauloubuntu/boto/merges","archive_url":"https://api.github.com/repos/pauloubuntu/boto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pauloubuntu/boto/downloads","issues_url":"https://api.github.com/repos/pauloubuntu/boto/issues{/number}","pulls_url":"https://api.github.com/repos/pauloubuntu/boto/pulls{/number}","milestones_url":"https://api.github.com/repos/pauloubuntu/boto/milestones{/number}","notifications_url":"https://api.github.com/repos/pauloubuntu/boto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pauloubuntu/boto/labels{/name}","releases_url":"https://api.github.com/repos/pauloubuntu/boto/releases{/id}","created_at":"2014-12-17T20:52:20Z","updated_at":"2015-01-30T11:21:12Z","pushed_at":"2015-01-30T11:21:12Z","git_url":"git://github.com/pauloubuntu/boto.git","ssh_url":"git@github.com:pauloubuntu/boto.git","clone_url":"https://github.com/pauloubuntu/boto.git","svn_url":"https://github.com/pauloubuntu/boto","homepage":"http://docs.pythonboto.org/","size":18346,"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":"develop"}},"base":{"label":"boto:develop","ref":"develop","sha":"fff13b68faaff7e60ac870bc78a45c901beeef3e","user":{"login":"boto","id":327752,"avatar_url":"https://avatars.githubusercontent.com/u/327752?v=3","gravatar_id":"","url":"https://api.github.com/users/boto","html_url":"https://github.com/boto","followers_url":"https://api.github.com/users/boto/followers","following_url":"https://api.github.com/users/boto/following{/other_user}","gists_url":"https://api.github.com/users/boto/gists{/gist_id}","starred_url":"https://api.github.com/users/boto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boto/subscriptions","organizations_url":"https://api.github.com/users/boto/orgs","repos_url":"https://api.github.com/users/boto/repos","events_url":"https://api.github.com/users/boto/events{/privacy}","received_events_url":"https://api.github.com/users/boto/received_events","type":"Organization","site_admin":false},"repo":{"id":771016,"name":"boto","full_name":"boto/boto","owner":{"login":"boto","id":327752,"avatar_url":"https://avatars.githubusercontent.com/u/327752?v=3","gravatar_id":"","url":"https://api.github.com/users/boto","html_url":"https://github.com/boto","followers_url":"https://api.github.com/users/boto/followers","following_url":"https://api.github.com/users/boto/following{/other_user}","gists_url":"https://api.github.com/users/boto/gists{/gist_id}","starred_url":"https://api.github.com/users/boto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boto/subscriptions","organizations_url":"https://api.github.com/users/boto/orgs","repos_url":"https://api.github.com/users/boto/repos","events_url":"https://api.github.com/users/boto/events{/privacy}","received_events_url":"https://api.github.com/users/boto/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/boto/boto","description":"Python interface to Amazon Web Services","fork":false,"url":"https://api.github.com/repos/boto/boto","forks_url":"https://api.github.com/repos/boto/boto/forks","keys_url":"https://api.github.com/repos/boto/boto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boto/boto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boto/boto/teams","hooks_url":"https://api.github.com/repos/boto/boto/hooks","issue_events_url":"https://api.github.com/repos/boto/boto/issues/events{/number}","events_url":"https://api.github.com/repos/boto/boto/events","assignees_url":"https://api.github.com/repos/boto/boto/assignees{/user}","branches_url":"https://api.github.com/repos/boto/boto/branches{/branch}","tags_url":"https://api.github.com/repos/boto/boto/tags","blobs_url":"https://api.github.com/repos/boto/boto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boto/boto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boto/boto/git/refs{/sha}","trees_url":"https://api.github.com/repos/boto/boto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boto/boto/statuses/{sha}","languages_url":"https://api.github.com/repos/boto/boto/languages","stargazers_url":"https://api.github.com/repos/boto/boto/stargazers","contributors_url":"https://api.github.com/repos/boto/boto/contributors","subscribers_url":"https://api.github.com/repos/boto/boto/subscribers","subscription_url":"https://api.github.com/repos/boto/boto/subscription","commits_url":"https://api.github.com/repos/boto/boto/commits{/sha}","git_commits_url":"https://api.github.com/repos/boto/boto/git/commits{/sha}","comments_url":"https://api.github.com/repos/boto/boto/comments{/number}","issue_comment_url":"https://api.github.com/repos/boto/boto/issues/comments/{number}","contents_url":"https://api.github.com/repos/boto/boto/contents/{+path}","compare_url":"https://api.github.com/repos/boto/boto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boto/boto/merges","archive_url":"https://api.github.com/repos/boto/boto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boto/boto/downloads","issues_url":"https://api.github.com/repos/boto/boto/issues{/number}","pulls_url":"https://api.github.com/repos/boto/boto/pulls{/number}","milestones_url":"https://api.github.com/repos/boto/boto/milestones{/number}","notifications_url":"https://api.github.com/repos/boto/boto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boto/boto/labels{/name}","releases_url":"https://api.github.com/repos/boto/boto/releases{/id}","created_at":"2010-07-12T19:15:33Z","updated_at":"2015-01-30T02:37:19Z","pushed_at":"2015-01-27T20:20:51Z","git_url":"git://github.com/boto/boto.git","ssh_url":"git@github.com:boto/boto.git","clone_url":"https://github.com/boto/boto.git","svn_url":"https://github.com/boto/boto","homepage":"http://docs.pythonboto.org/","size":40053,"stargazers_count":4494,"watchers_count":4494,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1581,"mirror_url":null,"open_issues_count":684,"forks":1581,"open_issues":684,"watchers":4494,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/boto/boto/pulls/2925"},"html":{"href":"https://github.com/boto/boto/pull/2925"},"issue":{"href":"https://api.github.com/repos/boto/boto/issues/2925"},"comments":{"href":"https://api.github.com/repos/boto/boto/issues/2925/comments"},"review_comments":{"href":"https://api.github.com/repos/boto/boto/pulls/2925/comments"},"review_comment":{"href":"https://api.github.com/repos/boto/boto/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/boto/boto/pulls/2925/commits"},"statuses":{"href":"https://api.github.com/repos/boto/boto/statuses/34a515d23e1ecc6e2930ef981dcab84f0970a6c8"}}}}