{"action":"created","comment":{"url":"https://api.github.com/repos/biocore/qiita/pulls/comments/24279658","id":24279658,"diff_hunk":"@@ -579,6 +579,40 @@ def _check_template_class(self, md_template):\n         if not isinstance(md_template, SampleTemplate):\n             raise IncompetentQiitaDeveloperError()\n \n+    def __setitem__(self, column, value):\n+        r\"\"\"Sets the metadata value for the category `column`\n+\n+        Parameters\n+        ----------\n+        column : str\n+            The column to update\n+        value : str\n+            The value to set. This is expected to be a str on the assumption\n+            that psycopg2 will cast as necessary when updating.\n+\n+        Raises\n+        ------\n+        QiitaDBColumnError\n+            If the column does not exist in the table\n+        \"\"\"\n+        conn_handler = SQLConnectionHandler()\n+\n+        exists = conn_handler.execute_fetchone(\"\"\"\n+            SELECT column_name\n+            FROM information_schema.columns\n+            WHERE table_name='{0}'\n+                AND column_name='{1}'\"\"\".format(self._dynamic_table, column))","path":"qiita_db/metadata_template.py","position":26,"original_position":26,"commit_id":"4b31d61e5a8407d05feddc63cfc29d54b63abcb6","original_commit_id":"4b31d61e5a8407d05feddc63cfc29d54b63abcb6","user":{"login":"adamrp","id":2574407,"avatar_url":"https://avatars.githubusercontent.com/u/2574407?v=3","gravatar_id":"","url":"https://api.github.com/users/adamrp","html_url":"https://github.com/adamrp","followers_url":"https://api.github.com/users/adamrp/followers","following_url":"https://api.github.com/users/adamrp/following{/other_user}","gists_url":"https://api.github.com/users/adamrp/gists{/gist_id}","starred_url":"https://api.github.com/users/adamrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamrp/subscriptions","organizations_url":"https://api.github.com/users/adamrp/orgs","repos_url":"https://api.github.com/users/adamrp/repos","events_url":"https://api.github.com/users/adamrp/events{/privacy}","received_events_url":"https://api.github.com/users/adamrp/received_events","type":"User","site_admin":false},"body":"As unlikely as it might be for a (table, column) to exist in a schema other than `qiita`, I feel that this query should also verify that the table_catalog = qiita and the table_schema = qiita","created_at":"2015-02-06T23:10:33Z","updated_at":"2015-02-06T23:10:33Z","html_url":"https://github.com/biocore/qiita/pull/824#discussion_r24279658","pull_request_url":"https://api.github.com/repos/biocore/qiita/pulls/824","_links":{"self":{"href":"https://api.github.com/repos/biocore/qiita/pulls/comments/24279658"},"html":{"href":"https://github.com/biocore/qiita/pull/824#discussion_r24279658"},"pull_request":{"href":"https://api.github.com/repos/biocore/qiita/pulls/824"}}},"pull_request":{"url":"https://api.github.com/repos/biocore/qiita/pulls/824","id":28742609,"html_url":"https://github.com/biocore/qiita/pull/824","diff_url":"https://github.com/biocore/qiita/pull/824.diff","patch_url":"https://github.com/biocore/qiita/pull/824.patch","issue_url":"https://api.github.com/repos/biocore/qiita/issues/824","number":824,"state":"open","locked":false,"title":"ENH/API: methods to update sample metadata","user":{"login":"wasade","id":474290,"avatar_url":"https://avatars.githubusercontent.com/u/474290?v=3","gravatar_id":"","url":"https://api.github.com/users/wasade","html_url":"https://github.com/wasade","followers_url":"https://api.github.com/users/wasade/followers","following_url":"https://api.github.com/users/wasade/following{/other_user}","gists_url":"https://api.github.com/users/wasade/gists{/gist_id}","starred_url":"https://api.github.com/users/wasade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasade/subscriptions","organizations_url":"https://api.github.com/users/wasade/orgs","repos_url":"https://api.github.com/users/wasade/repos","events_url":"https://api.github.com/users/wasade/events{/privacy}","received_events_url":"https://api.github.com/users/wasade/received_events","type":"User","site_admin":false},"body":"Partially addresses #822. These changes include:\r\n\r\n* updating of existing sample metadata\r\n* adding new columns\r\n* removing columns\r\n\r\nRight now, this is limited to the SampleTemplate, and support is not in\r\nfor the PrepTemplate. This would be easy to change, but put it in place\r\nthis way based on the email traffic I saw regarding the issue.\r\n\r\nThe API for get/set/del at the template level is not consistent yet. Pushing\r\nin now to exercise full tests, and will issue follow up commits to resolve the\r\ninconsistencies.","created_at":"2015-02-05T17:13:34Z","updated_at":"2015-02-06T23:10:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e150d52f6f3160961b0d98f01889afd8d1b35a18","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/biocore/qiita/pulls/824/commits","review_comments_url":"https://api.github.com/repos/biocore/qiita/pulls/824/comments","review_comment_url":"https://api.github.com/repos/biocore/qiita/pulls/comments/{number}","comments_url":"https://api.github.com/repos/biocore/qiita/issues/824/comments","statuses_url":"https://api.github.com/repos/biocore/qiita/statuses/4b31d61e5a8407d05feddc63cfc29d54b63abcb6","head":{"label":"wasade:update_metadata","ref":"update_metadata","sha":"4b31d61e5a8407d05feddc63cfc29d54b63abcb6","user":{"login":"wasade","id":474290,"avatar_url":"https://avatars.githubusercontent.com/u/474290?v=3","gravatar_id":"","url":"https://api.github.com/users/wasade","html_url":"https://github.com/wasade","followers_url":"https://api.github.com/users/wasade/followers","following_url":"https://api.github.com/users/wasade/following{/other_user}","gists_url":"https://api.github.com/users/wasade/gists{/gist_id}","starred_url":"https://api.github.com/users/wasade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasade/subscriptions","organizations_url":"https://api.github.com/users/wasade/orgs","repos_url":"https://api.github.com/users/wasade/repos","events_url":"https://api.github.com/users/wasade/events{/privacy}","received_events_url":"https://api.github.com/users/wasade/received_events","type":"User","site_admin":false},"repo":{"id":16965198,"name":"qiita","full_name":"wasade/qiita","owner":{"login":"wasade","id":474290,"avatar_url":"https://avatars.githubusercontent.com/u/474290?v=3","gravatar_id":"","url":"https://api.github.com/users/wasade","html_url":"https://github.com/wasade","followers_url":"https://api.github.com/users/wasade/followers","following_url":"https://api.github.com/users/wasade/following{/other_user}","gists_url":"https://api.github.com/users/wasade/gists{/gist_id}","starred_url":"https://api.github.com/users/wasade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wasade/subscriptions","organizations_url":"https://api.github.com/users/wasade/orgs","repos_url":"https://api.github.com/users/wasade/repos","events_url":"https://api.github.com/users/wasade/events{/privacy}","received_events_url":"https://api.github.com/users/wasade/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wasade/qiita","description":"Qiita - A QIIME databasing effort","fork":true,"url":"https://api.github.com/repos/wasade/qiita","forks_url":"https://api.github.com/repos/wasade/qiita/forks","keys_url":"https://api.github.com/repos/wasade/qiita/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wasade/qiita/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wasade/qiita/teams","hooks_url":"https://api.github.com/repos/wasade/qiita/hooks","issue_events_url":"https://api.github.com/repos/wasade/qiita/issues/events{/number}","events_url":"https://api.github.com/repos/wasade/qiita/events","assignees_url":"https://api.github.com/repos/wasade/qiita/assignees{/user}","branches_url":"https://api.github.com/repos/wasade/qiita/branches{/branch}","tags_url":"https://api.github.com/repos/wasade/qiita/tags","blobs_url":"https://api.github.com/repos/wasade/qiita/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wasade/qiita/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wasade/qiita/git/refs{/sha}","trees_url":"https://api.github.com/repos/wasade/qiita/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wasade/qiita/statuses/{sha}","languages_url":"https://api.github.com/repos/wasade/qiita/languages","stargazers_url":"https://api.github.com/repos/wasade/qiita/stargazers","contributors_url":"https://api.github.com/repos/wasade/qiita/contributors","subscribers_url":"https://api.github.com/repos/wasade/qiita/subscribers","subscription_url":"https://api.github.com/repos/wasade/qiita/subscription","commits_url":"https://api.github.com/repos/wasade/qiita/commits{/sha}","git_commits_url":"https://api.github.com/repos/wasade/qiita/git/commits{/sha}","comments_url":"https://api.github.com/repos/wasade/qiita/comments{/number}","issue_comment_url":"https://api.github.com/repos/wasade/qiita/issues/comments/{number}","contents_url":"https://api.github.com/repos/wasade/qiita/contents/{+path}","compare_url":"https://api.github.com/repos/wasade/qiita/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wasade/qiita/merges","archive_url":"https://api.github.com/repos/wasade/qiita/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wasade/qiita/downloads","issues_url":"https://api.github.com/repos/wasade/qiita/issues{/number}","pulls_url":"https://api.github.com/repos/wasade/qiita/pulls{/number}","milestones_url":"https://api.github.com/repos/wasade/qiita/milestones{/number}","notifications_url":"https://api.github.com/repos/wasade/qiita/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wasade/qiita/labels{/name}","releases_url":"https://api.github.com/repos/wasade/qiita/releases{/id}","created_at":"2014-02-18T21:56:52Z","updated_at":"2014-12-21T17:09:07Z","pushed_at":"2015-02-05T19:37:49Z","git_url":"git://github.com/wasade/qiita.git","ssh_url":"git@github.com:wasade/qiita.git","clone_url":"https://github.com/wasade/qiita.git","svn_url":"https://github.com/wasade/qiita","homepage":"","size":113292,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"biocore:master","ref":"master","sha":"c06f6cdfcd85b1a2c7505136425d46e999dd06cf","user":{"login":"biocore","id":6241857,"avatar_url":"https://avatars.githubusercontent.com/u/6241857?v=3","gravatar_id":"","url":"https://api.github.com/users/biocore","html_url":"https://github.com/biocore","followers_url":"https://api.github.com/users/biocore/followers","following_url":"https://api.github.com/users/biocore/following{/other_user}","gists_url":"https://api.github.com/users/biocore/gists{/gist_id}","starred_url":"https://api.github.com/users/biocore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biocore/subscriptions","organizations_url":"https://api.github.com/users/biocore/orgs","repos_url":"https://api.github.com/users/biocore/repos","events_url":"https://api.github.com/users/biocore/events{/privacy}","received_events_url":"https://api.github.com/users/biocore/received_events","type":"Organization","site_admin":false},"repo":{"id":13131245,"name":"qiita","full_name":"biocore/qiita","owner":{"login":"biocore","id":6241857,"avatar_url":"https://avatars.githubusercontent.com/u/6241857?v=3","gravatar_id":"","url":"https://api.github.com/users/biocore","html_url":"https://github.com/biocore","followers_url":"https://api.github.com/users/biocore/followers","following_url":"https://api.github.com/users/biocore/following{/other_user}","gists_url":"https://api.github.com/users/biocore/gists{/gist_id}","starred_url":"https://api.github.com/users/biocore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/biocore/subscriptions","organizations_url":"https://api.github.com/users/biocore/orgs","repos_url":"https://api.github.com/users/biocore/repos","events_url":"https://api.github.com/users/biocore/events{/privacy}","received_events_url":"https://api.github.com/users/biocore/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/biocore/qiita","description":"Qiita - A QIIME databasing effort","fork":false,"url":"https://api.github.com/repos/biocore/qiita","forks_url":"https://api.github.com/repos/biocore/qiita/forks","keys_url":"https://api.github.com/repos/biocore/qiita/keys{/key_id}","collaborators_url":"https://api.github.com/repos/biocore/qiita/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/biocore/qiita/teams","hooks_url":"https://api.github.com/repos/biocore/qiita/hooks","issue_events_url":"https://api.github.com/repos/biocore/qiita/issues/events{/number}","events_url":"https://api.github.com/repos/biocore/qiita/events","assignees_url":"https://api.github.com/repos/biocore/qiita/assignees{/user}","branches_url":"https://api.github.com/repos/biocore/qiita/branches{/branch}","tags_url":"https://api.github.com/repos/biocore/qiita/tags","blobs_url":"https://api.github.com/repos/biocore/qiita/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/biocore/qiita/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/biocore/qiita/git/refs{/sha}","trees_url":"https://api.github.com/repos/biocore/qiita/git/trees{/sha}","statuses_url":"https://api.github.com/repos/biocore/qiita/statuses/{sha}","languages_url":"https://api.github.com/repos/biocore/qiita/languages","stargazers_url":"https://api.github.com/repos/biocore/qiita/stargazers","contributors_url":"https://api.github.com/repos/biocore/qiita/contributors","subscribers_url":"https://api.github.com/repos/biocore/qiita/subscribers","subscription_url":"https://api.github.com/repos/biocore/qiita/subscription","commits_url":"https://api.github.com/repos/biocore/qiita/commits{/sha}","git_commits_url":"https://api.github.com/repos/biocore/qiita/git/commits{/sha}","comments_url":"https://api.github.com/repos/biocore/qiita/comments{/number}","issue_comment_url":"https://api.github.com/repos/biocore/qiita/issues/comments/{number}","contents_url":"https://api.github.com/repos/biocore/qiita/contents/{+path}","compare_url":"https://api.github.com/repos/biocore/qiita/compare/{base}...{head}","merges_url":"https://api.github.com/repos/biocore/qiita/merges","archive_url":"https://api.github.com/repos/biocore/qiita/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/biocore/qiita/downloads","issues_url":"https://api.github.com/repos/biocore/qiita/issues{/number}","pulls_url":"https://api.github.com/repos/biocore/qiita/pulls{/number}","milestones_url":"https://api.github.com/repos/biocore/qiita/milestones{/number}","notifications_url":"https://api.github.com/repos/biocore/qiita/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/biocore/qiita/labels{/name}","releases_url":"https://api.github.com/repos/biocore/qiita/releases{/id}","created_at":"2013-09-26T18:50:43Z","updated_at":"2015-02-06T02:22:25Z","pushed_at":"2015-02-06T02:22:25Z","git_url":"git://github.com/biocore/qiita.git","ssh_url":"git@github.com:biocore/qiita.git","clone_url":"https://github.com/biocore/qiita.git","svn_url":"https://github.com/biocore/qiita","homepage":"","size":117009,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":180,"forks":13,"open_issues":180,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biocore/qiita/pulls/824"},"html":{"href":"https://github.com/biocore/qiita/pull/824"},"issue":{"href":"https://api.github.com/repos/biocore/qiita/issues/824"},"comments":{"href":"https://api.github.com/repos/biocore/qiita/issues/824/comments"},"review_comments":{"href":"https://api.github.com/repos/biocore/qiita/pulls/824/comments"},"review_comment":{"href":"https://api.github.com/repos/biocore/qiita/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/biocore/qiita/pulls/824/commits"},"statuses":{"href":"https://api.github.com/repos/biocore/qiita/statuses/4b31d61e5a8407d05feddc63cfc29d54b63abcb6"}}}}