{"action":"created","comment":{"url":"https://api.github.com/repos/pynamodb/PynamoDB/pulls/comments/134775948","pull_request_review_id":58107836,"id":134775948,"diff_hunk":"@@ -142,7 +122,7 @@ You can check for conditional operation failures by inspecting the cause of the\n .. code-block:: python\n \n     try:\n-        thread_item.save(forum_name__null=False)\n+        thread_item.save(Thread.forum_name.exists())\n     except PutError as e:","path":"docs/conditional.rst","position":190,"original_position":190,"commit_id":"76c3db0adb39d60f0edb77a1890fcb57dbc5811c","original_commit_id":"76c3db0adb39d60f0edb77a1890fcb57dbc5811c","user":{"login":"jpinner-lyft","id":12147597,"avatar_url":"https://avatars2.githubusercontent.com/u/12147597?v=4","gravatar_id":"","url":"https://api.github.com/users/jpinner-lyft","html_url":"https://github.com/jpinner-lyft","followers_url":"https://api.github.com/users/jpinner-lyft/followers","following_url":"https://api.github.com/users/jpinner-lyft/following{/other_user}","gists_url":"https://api.github.com/users/jpinner-lyft/gists{/gist_id}","starred_url":"https://api.github.com/users/jpinner-lyft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpinner-lyft/subscriptions","organizations_url":"https://api.github.com/users/jpinner-lyft/orgs","repos_url":"https://api.github.com/users/jpinner-lyft/repos","events_url":"https://api.github.com/users/jpinner-lyft/events{/privacy}","received_events_url":"https://api.github.com/users/jpinner-lyft/received_events","type":"User","site_admin":false},"body":"The problem here, by the way, is that both `PutError`, `DeleteError`, and `UpdateError` can have the `ConditionalCheckFailedException` error code. So I'd have to make three subclasses and users would have to choose the correct one.","created_at":"2017-08-23T14:54:54Z","updated_at":"2017-08-23T14:54:55Z","html_url":"https://github.com/pynamodb/PynamoDB/pull/336#discussion_r134775948","pull_request_url":"https://api.github.com/repos/pynamodb/PynamoDB/pulls/336","_links":{"self":{"href":"https://api.github.com/repos/pynamodb/PynamoDB/pulls/comments/134775948"},"html":{"href":"https://github.com/pynamodb/PynamoDB/pull/336#discussion_r134775948"},"pull_request":{"href":"https://api.github.com/repos/pynamodb/PynamoDB/pulls/336"}}},"pull_request":{"url":"https://api.github.com/repos/pynamodb/PynamoDB/pulls/336","id":136882731,"html_url":"https://github.com/pynamodb/PynamoDB/pull/336","diff_url":"https://github.com/pynamodb/PynamoDB/pull/336.diff","patch_url":"https://github.com/pynamodb/PynamoDB/pull/336.patch","issue_url":"https://api.github.com/repos/pynamodb/PynamoDB/issues/336","number":336,"state":"open","locked":false,"title":"Conditional Operations using Condition Expressions","user":{"login":"jpinner-lyft","id":12147597,"avatar_url":"https://avatars2.githubusercontent.com/u/12147597?v=4","gravatar_id":"","url":"https://api.github.com/users/jpinner-lyft","html_url":"https://github.com/jpinner-lyft","followers_url":"https://api.github.com/users/jpinner-lyft/followers","following_url":"https://api.github.com/users/jpinner-lyft/following{/other_user}","gists_url":"https://api.github.com/users/jpinner-lyft/gists{/gist_id}","starred_url":"https://api.github.com/users/jpinner-lyft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpinner-lyft/subscriptions","organizations_url":"https://api.github.com/users/jpinner-lyft/orgs","repos_url":"https://api.github.com/users/jpinner-lyft/repos","events_url":"https://api.github.com/users/jpinner-lyft/events{/privacy}","received_events_url":"https://api.github.com/users/jpinner-lyft/received_events","type":"User","site_admin":false},"body":"This PR is the fifth step towards moving off of the legacy conditional parameters (#219).\r\n\r\nWith this change, `delete_item`, `put_item`, and `update_item` (along with their corresponding model functions, `delete`, `save`, and `update`) now take an additional keyword arg, `condition`.\r\n\r\nAny condition expression can be used for these conditional operations. Using legacy conditional parameters will emit a `warning`. Using both condition expressions and legacy parameters will raise a `ValueError`.","created_at":"2017-08-22T03:06:29Z","updated_at":"2017-08-23T14:54:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2995f20b69ddac823f3468eecba9f42a40581ae3","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jlafon","id":236514,"avatar_url":"https://avatars2.githubusercontent.com/u/236514?v=4","gravatar_id":"","url":"https://api.github.com/users/jlafon","html_url":"https://github.com/jlafon","followers_url":"https://api.github.com/users/jlafon/followers","following_url":"https://api.github.com/users/jlafon/following{/other_user}","gists_url":"https://api.github.com/users/jlafon/gists{/gist_id}","starred_url":"https://api.github.com/users/jlafon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlafon/subscriptions","organizations_url":"https://api.github.com/users/jlafon/orgs","repos_url":"https://api.github.com/users/jlafon/repos","events_url":"https://api.github.com/users/jlafon/events{/privacy}","received_events_url":"https://api.github.com/users/jlafon/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pynamodb/PynamoDB/pulls/336/commits","review_comments_url":"https://api.github.com/repos/pynamodb/PynamoDB/pulls/336/comments","review_comment_url":"https://api.github.com/repos/pynamodb/PynamoDB/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pynamodb/PynamoDB/issues/336/comments","statuses_url":"https://api.github.com/repos/pynamodb/PynamoDB/statuses/76c3db0adb39d60f0edb77a1890fcb57dbc5811c","head":{"label":"pynamodb:conditional-operations","ref":"conditional-operations","sha":"76c3db0adb39d60f0edb77a1890fcb57dbc5811c","user":{"login":"pynamodb","id":27022537,"avatar_url":"https://avatars2.githubusercontent.com/u/27022537?v=4","gravatar_id":"","url":"https://api.github.com/users/pynamodb","html_url":"https://github.com/pynamodb","followers_url":"https://api.github.com/users/pynamodb/followers","following_url":"https://api.github.com/users/pynamodb/following{/other_user}","gists_url":"https://api.github.com/users/pynamodb/gists{/gist_id}","starred_url":"https://api.github.com/users/pynamodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pynamodb/subscriptions","organizations_url":"https://api.github.com/users/pynamodb/orgs","repos_url":"https://api.github.com/users/pynamodb/repos","events_url":"https://api.github.com/users/pynamodb/events{/privacy}","received_events_url":"https://api.github.com/users/pynamodb/received_events","type":"Organization","site_admin":false},"repo":{"id":16058979,"name":"PynamoDB","full_name":"pynamodb/PynamoDB","owner":{"login":"pynamodb","id":27022537,"avatar_url":"https://avatars2.githubusercontent.com/u/27022537?v=4","gravatar_id":"","url":"https://api.github.com/users/pynamodb","html_url":"https://github.com/pynamodb","followers_url":"https://api.github.com/users/pynamodb/followers","following_url":"https://api.github.com/users/pynamodb/following{/other_user}","gists_url":"https://api.github.com/users/pynamodb/gists{/gist_id}","starred_url":"https://api.github.com/users/pynamodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pynamodb/subscriptions","organizations_url":"https://api.github.com/users/pynamodb/orgs","repos_url":"https://api.github.com/users/pynamodb/repos","events_url":"https://api.github.com/users/pynamodb/events{/privacy}","received_events_url":"https://api.github.com/users/pynamodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pynamodb/PynamoDB","description":"A pythonic interface to Amazon's DynamoDB","fork":false,"url":"https://api.github.com/repos/pynamodb/PynamoDB","forks_url":"https://api.github.com/repos/pynamodb/PynamoDB/forks","keys_url":"https://api.github.com/repos/pynamodb/PynamoDB/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pynamodb/PynamoDB/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pynamodb/PynamoDB/teams","hooks_url":"https://api.github.com/repos/pynamodb/PynamoDB/hooks","issue_events_url":"https://api.github.com/repos/pynamodb/PynamoDB/issues/events{/number}","events_url":"https://api.github.com/repos/pynamodb/PynamoDB/events","assignees_url":"https://api.github.com/repos/pynamodb/PynamoDB/assignees{/user}","branches_url":"https://api.github.com/repos/pynamodb/PynamoDB/branches{/branch}","tags_url":"https://api.github.com/repos/pynamodb/PynamoDB/tags","blobs_url":"https://api.github.com/repos/pynamodb/PynamoDB/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pynamodb/PynamoDB/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pynamodb/PynamoDB/git/refs{/sha}","trees_url":"https://api.github.com/repos/pynamodb/PynamoDB/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pynamodb/PynamoDB/statuses/{sha}","languages_url":"https://api.github.com/repos/pynamodb/PynamoDB/languages","stargazers_url":"https://api.github.com/repos/pynamodb/PynamoDB/stargazers","contributors_url":"https://api.github.com/repos/pynamodb/PynamoDB/contributors","subscribers_url":"https://api.github.com/repos/pynamodb/PynamoDB/subscribers","subscription_url":"https://api.github.com/repos/pynamodb/PynamoDB/subscription","commits_url":"https://api.github.com/repos/pynamodb/PynamoDB/commits{/sha}","git_commits_url":"https://api.github.com/repos/pynamodb/PynamoDB/git/commits{/sha}","comments_url":"https://api.github.com/repos/pynamodb/PynamoDB/comments{/number}","issue_comment_url":"https://api.github.com/repos/pynamodb/PynamoDB/issues/comments{/number}","contents_url":"https://api.github.com/repos/pynamodb/PynamoDB/contents/{+path}","compare_url":"https://api.github.com/repos/pynamodb/PynamoDB/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pynamodb/PynamoDB/merges","archive_url":"https://api.github.com/repos/pynamodb/PynamoDB/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pynamodb/PynamoDB/downloads","issues_url":"https://api.github.com/repos/pynamodb/PynamoDB/issues{/number}","pulls_url":"https://api.github.com/repos/pynamodb/PynamoDB/pulls{/number}","milestones_url":"https://api.github.com/repos/pynamodb/PynamoDB/milestones{/number}","notifications_url":"https://api.github.com/repos/pynamodb/PynamoDB/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pynamodb/PynamoDB/labels{/name}","releases_url":"https://api.github.com/repos/pynamodb/PynamoDB/releases{/id}","deployments_url":"https://api.github.com/repos/pynamodb/PynamoDB/deployments","created_at":"2014-01-20T02:18:35Z","updated_at":"2017-08-23T12:34:28Z","pushed_at":"2017-08-22T06:15:26Z","git_url":"git://github.com/pynamodb/PynamoDB.git","ssh_url":"git@github.com:pynamodb/PynamoDB.git","clone_url":"https://github.com/pynamodb/PynamoDB.git","svn_url":"https://github.com/pynamodb/PynamoDB","homepage":"http://pynamodb.readthedocs.org","size":1294,"stargazers_count":453,"watchers_count":453,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":119,"mirror_url":null,"open_issues_count":80,"forks":119,"open_issues":80,"watchers":453,"default_branch":"master"}},"base":{"label":"pynamodb:master","ref":"master","sha":"d009e9179eba5a3b8935f13be059bcf8c8d59e55","user":{"login":"pynamodb","id":27022537,"avatar_url":"https://avatars2.githubusercontent.com/u/27022537?v=4","gravatar_id":"","url":"https://api.github.com/users/pynamodb","html_url":"https://github.com/pynamodb","followers_url":"https://api.github.com/users/pynamodb/followers","following_url":"https://api.github.com/users/pynamodb/following{/other_user}","gists_url":"https://api.github.com/users/pynamodb/gists{/gist_id}","starred_url":"https://api.github.com/users/pynamodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pynamodb/subscriptions","organizations_url":"https://api.github.com/users/pynamodb/orgs","repos_url":"https://api.github.com/users/pynamodb/repos","events_url":"https://api.github.com/users/pynamodb/events{/privacy}","received_events_url":"https://api.github.com/users/pynamodb/received_events","type":"Organization","site_admin":false},"repo":{"id":16058979,"name":"PynamoDB","full_name":"pynamodb/PynamoDB","owner":{"login":"pynamodb","id":27022537,"avatar_url":"https://avatars2.githubusercontent.com/u/27022537?v=4","gravatar_id":"","url":"https://api.github.com/users/pynamodb","html_url":"https://github.com/pynamodb","followers_url":"https://api.github.com/users/pynamodb/followers","following_url":"https://api.github.com/users/pynamodb/following{/other_user}","gists_url":"https://api.github.com/users/pynamodb/gists{/gist_id}","starred_url":"https://api.github.com/users/pynamodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pynamodb/subscriptions","organizations_url":"https://api.github.com/users/pynamodb/orgs","repos_url":"https://api.github.com/users/pynamodb/repos","events_url":"https://api.github.com/users/pynamodb/events{/privacy}","received_events_url":"https://api.github.com/users/pynamodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pynamodb/PynamoDB","description":"A pythonic interface to Amazon's DynamoDB","fork":false,"url":"https://api.github.com/repos/pynamodb/PynamoDB","forks_url":"https://api.github.com/repos/pynamodb/PynamoDB/forks","keys_url":"https://api.github.com/repos/pynamodb/PynamoDB/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pynamodb/PynamoDB/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pynamodb/PynamoDB/teams","hooks_url":"https://api.github.com/repos/pynamodb/PynamoDB/hooks","issue_events_url":"https://api.github.com/repos/pynamodb/PynamoDB/issues/events{/number}","events_url":"https://api.github.com/repos/pynamodb/PynamoDB/events","assignees_url":"https://api.github.com/repos/pynamodb/PynamoDB/assignees{/user}","branches_url":"https://api.github.com/repos/pynamodb/PynamoDB/branches{/branch}","tags_url":"https://api.github.com/repos/pynamodb/PynamoDB/tags","blobs_url":"https://api.github.com/repos/pynamodb/PynamoDB/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pynamodb/PynamoDB/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pynamodb/PynamoDB/git/refs{/sha}","trees_url":"https://api.github.com/repos/pynamodb/PynamoDB/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pynamodb/PynamoDB/statuses/{sha}","languages_url":"https://api.github.com/repos/pynamodb/PynamoDB/languages","stargazers_url":"https://api.github.com/repos/pynamodb/PynamoDB/stargazers","contributors_url":"https://api.github.com/repos/pynamodb/PynamoDB/contributors","subscribers_url":"https://api.github.com/repos/pynamodb/PynamoDB/subscribers","subscription_url":"https://api.github.com/repos/pynamodb/PynamoDB/subscription","commits_url":"https://api.github.com/repos/pynamodb/PynamoDB/commits{/sha}","git_commits_url":"https://api.github.com/repos/pynamodb/PynamoDB/git/commits{/sha}","comments_url":"https://api.github.com/repos/pynamodb/PynamoDB/comments{/number}","issue_comment_url":"https://api.github.com/repos/pynamodb/PynamoDB/issues/comments{/number}","contents_url":"https://api.github.com/repos/pynamodb/PynamoDB/contents/{+path}","compare_url":"https://api.github.com/repos/pynamodb/PynamoDB/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pynamodb/PynamoDB/merges","archive_url":"https://api.github.com/repos/pynamodb/PynamoDB/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pynamodb/PynamoDB/downloads","issues_url":"https://api.github.com/repos/pynamodb/PynamoDB/issues{/number}","pulls_url":"https://api.github.com/repos/pynamodb/PynamoDB/pulls{/number}","milestones_url":"https://api.github.com/repos/pynamodb/PynamoDB/milestones{/number}","notifications_url":"https://api.github.com/repos/pynamodb/PynamoDB/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pynamodb/PynamoDB/labels{/name}","releases_url":"https://api.github.com/repos/pynamodb/PynamoDB/releases{/id}","deployments_url":"https://api.github.com/repos/pynamodb/PynamoDB/deployments","created_at":"2014-01-20T02:18:35Z","updated_at":"2017-08-23T12:34:28Z","pushed_at":"2017-08-22T06:15:26Z","git_url":"git://github.com/pynamodb/PynamoDB.git","ssh_url":"git@github.com:pynamodb/PynamoDB.git","clone_url":"https://github.com/pynamodb/PynamoDB.git","svn_url":"https://github.com/pynamodb/PynamoDB","homepage":"http://pynamodb.readthedocs.org","size":1294,"stargazers_count":453,"watchers_count":453,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":119,"mirror_url":null,"open_issues_count":80,"forks":119,"open_issues":80,"watchers":453,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pynamodb/PynamoDB/pulls/336"},"html":{"href":"https://github.com/pynamodb/PynamoDB/pull/336"},"issue":{"href":"https://api.github.com/repos/pynamodb/PynamoDB/issues/336"},"comments":{"href":"https://api.github.com/repos/pynamodb/PynamoDB/issues/336/comments"},"review_comments":{"href":"https://api.github.com/repos/pynamodb/PynamoDB/pulls/336/comments"},"review_comment":{"href":"https://api.github.com/repos/pynamodb/PynamoDB/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pynamodb/PynamoDB/pulls/336/commits"},"statuses":{"href":"https://api.github.com/repos/pynamodb/PynamoDB/statuses/76c3db0adb39d60f0edb77a1890fcb57dbc5811c"}}}}
{"actor":{"display_login":"jpinner-lyft"}}