{"action":"created","comment":{"url":"https://api.github.com/repos/biocore/qiita/pulls/comments/24697425","id":24697425,"diff_hunk":"@@ -421,6 +422,68 @@ def test_purge_filepaths(self):\n         self.assertTrue(exists(fp1))\n         self.assertFalse(exists(fp_exp_id))\n \n+    def test_purge_filepaths_null_cols(self):\n+        \"\"\"Tests the nulls vs not in issue in purge_filepaths\"\"\"\n+        # For more details about the issue:\n+        # http://www.depesz.com/2008/08/13/nulls-vs-not-in/\n+        # In the current set up, the only place where we can actually have a\n+        # null value in a filepath id is in the reference table. Add a new\n+        # reference without tree and taxonomy:\n+        fd, seqs_fp = mkstemp(suffix=\"_seqs.fna\")\n+        close(fd)\n+        ref = Reference.create(\"null_db\", \"13_2\", seqs_fp)\n+        self.files_to_remove.append(ref.sequence_fp)\n+        # Add a new filepath to the database\n+        fd, fp = mkstemp()\n+        close(fd)\n+        exp_id = 1 + self.conn_handler.execute_fetchone(\n+            \"SELECT count(1) FROM qiita.filepath\")[0]\n+        fp_id = self.conn_handler.execute_fetchone(\n+            \"INSERT INTO qiita.filepath \"\n+            \"(filepath, filepath_type_id, checksum, checksum_algorithm_id) \"\n+            \"VALUES (%s, %s, %s, %s) RETURNING filepath_id\", (fp, 1, \"\", 1))[0]\n+        self.assertEqual(fp_id, exp_id)\n+\n+        # Connect the just added filepath to a raw data\n+        self.conn_handler.execute(","path":"qiita_db/test/test_util.py","position":35,"original_position":35,"commit_id":"4ca81fd3b4f7c9d042fcaceffa0ebf6be85b1423","original_commit_id":"4ca81fd3b4f7c9d042fcaceffa0ebf6be85b1423","user":{"login":"josenavas","id":2501478,"avatar_url":"https://avatars.githubusercontent.com/u/2501478?v=3","gravatar_id":"","url":"https://api.github.com/users/josenavas","html_url":"https://github.com/josenavas","followers_url":"https://api.github.com/users/josenavas/followers","following_url":"https://api.github.com/users/josenavas/following{/other_user}","gists_url":"https://api.github.com/users/josenavas/gists{/gist_id}","starred_url":"https://api.github.com/users/josenavas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josenavas/subscriptions","organizations_url":"https://api.github.com/users/josenavas/orgs","repos_url":"https://api.github.com/users/josenavas/repos","events_url":"https://api.github.com/users/josenavas/events{/privacy}","received_events_url":"https://api.github.com/users/josenavas/received_events","type":"User","site_admin":false},"body":"I've changed it for a couple of API calls (and fixed them in the previous test as it was a copy-paste...)","created_at":"2015-02-13T21:16:56Z","updated_at":"2015-02-13T21:16:56Z","html_url":"https://github.com/biocore/qiita/pull/837#discussion_r24697425","pull_request_url":"https://api.github.com/repos/biocore/qiita/pulls/837","_links":{"self":{"href":"https://api.github.com/repos/biocore/qiita/pulls/comments/24697425"},"html":{"href":"https://github.com/biocore/qiita/pull/837#discussion_r24697425"},"pull_request":{"href":"https://api.github.com/repos/biocore/qiita/pulls/837"}}},"pull_request":{"url":"https://api.github.com/repos/biocore/qiita/pulls/837","id":28957850,"html_url":"https://github.com/biocore/qiita/pull/837","diff_url":"https://github.com/biocore/qiita/pull/837.diff","patch_url":"https://github.com/biocore/qiita/pull/837.patch","issue_url":"https://api.github.com/repos/biocore/qiita/issues/837","number":837,"state":"open","locked":false,"title":"Refactor purge function","user":{"login":"josenavas","id":2501478,"avatar_url":"https://avatars.githubusercontent.com/u/2501478?v=3","gravatar_id":"","url":"https://api.github.com/users/josenavas","html_url":"https://github.com/josenavas","followers_url":"https://api.github.com/users/josenavas/followers","following_url":"https://api.github.com/users/josenavas/following{/other_user}","gists_url":"https://api.github.com/users/josenavas/gists{/gist_id}","starred_url":"https://api.github.com/users/josenavas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josenavas/subscriptions","organizations_url":"https://api.github.com/users/josenavas/orgs","repos_url":"https://api.github.com/users/josenavas/repos","events_url":"https://api.github.com/users/josenavas/events{/privacy}","received_events_url":"https://api.github.com/users/josenavas/received_events","type":"User","site_admin":false},"body":"Fixes (partially) https://github.com/biocore/qiita/issues/834\r\n\r\nSome tables where missing on the `purge_filepaths` function. Now these tables are fetched programmatically, so this issue should not arise again.\r\n\r\nAlso, there was a line that should not be there at all, so I removed it. I'm actually surprise that the code was working with that line in there. The function `move_filepaths_to_upload_folder` also has that line added, so I removed it too.","created_at":"2015-02-09T21:25:11Z","updated_at":"2015-02-13T21:16:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8840dd958352e91ae01d32d74386c7d670218041","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/biocore/qiita/pulls/837/commits","review_comments_url":"https://api.github.com/repos/biocore/qiita/pulls/837/comments","review_comment_url":"https://api.github.com/repos/biocore/qiita/pulls/comments/{number}","comments_url":"https://api.github.com/repos/biocore/qiita/issues/837/comments","statuses_url":"https://api.github.com/repos/biocore/qiita/statuses/4ca81fd3b4f7c9d042fcaceffa0ebf6be85b1423","head":{"label":"josenavas:refactor-purge-function","ref":"refactor-purge-function","sha":"4ca81fd3b4f7c9d042fcaceffa0ebf6be85b1423","user":{"login":"josenavas","id":2501478,"avatar_url":"https://avatars.githubusercontent.com/u/2501478?v=3","gravatar_id":"","url":"https://api.github.com/users/josenavas","html_url":"https://github.com/josenavas","followers_url":"https://api.github.com/users/josenavas/followers","following_url":"https://api.github.com/users/josenavas/following{/other_user}","gists_url":"https://api.github.com/users/josenavas/gists{/gist_id}","starred_url":"https://api.github.com/users/josenavas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josenavas/subscriptions","organizations_url":"https://api.github.com/users/josenavas/orgs","repos_url":"https://api.github.com/users/josenavas/repos","events_url":"https://api.github.com/users/josenavas/events{/privacy}","received_events_url":"https://api.github.com/users/josenavas/received_events","type":"User","site_admin":false},"repo":{"id":13527677,"name":"QiiTa","full_name":"josenavas/QiiTa","owner":{"login":"josenavas","id":2501478,"avatar_url":"https://avatars.githubusercontent.com/u/2501478?v=3","gravatar_id":"","url":"https://api.github.com/users/josenavas","html_url":"https://github.com/josenavas","followers_url":"https://api.github.com/users/josenavas/followers","following_url":"https://api.github.com/users/josenavas/following{/other_user}","gists_url":"https://api.github.com/users/josenavas/gists{/gist_id}","starred_url":"https://api.github.com/users/josenavas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josenavas/subscriptions","organizations_url":"https://api.github.com/users/josenavas/orgs","repos_url":"https://api.github.com/users/josenavas/repos","events_url":"https://api.github.com/users/josenavas/events{/privacy}","received_events_url":"https://api.github.com/users/josenavas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/josenavas/QiiTa","description":"QiiTa databasing effort","fork":true,"url":"https://api.github.com/repos/josenavas/QiiTa","forks_url":"https://api.github.com/repos/josenavas/QiiTa/forks","keys_url":"https://api.github.com/repos/josenavas/QiiTa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/josenavas/QiiTa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/josenavas/QiiTa/teams","hooks_url":"https://api.github.com/repos/josenavas/QiiTa/hooks","issue_events_url":"https://api.github.com/repos/josenavas/QiiTa/issues/events{/number}","events_url":"https://api.github.com/repos/josenavas/QiiTa/events","assignees_url":"https://api.github.com/repos/josenavas/QiiTa/assignees{/user}","branches_url":"https://api.github.com/repos/josenavas/QiiTa/branches{/branch}","tags_url":"https://api.github.com/repos/josenavas/QiiTa/tags","blobs_url":"https://api.github.com/repos/josenavas/QiiTa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/josenavas/QiiTa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/josenavas/QiiTa/git/refs{/sha}","trees_url":"https://api.github.com/repos/josenavas/QiiTa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/josenavas/QiiTa/statuses/{sha}","languages_url":"https://api.github.com/repos/josenavas/QiiTa/languages","stargazers_url":"https://api.github.com/repos/josenavas/QiiTa/stargazers","contributors_url":"https://api.github.com/repos/josenavas/QiiTa/contributors","subscribers_url":"https://api.github.com/repos/josenavas/QiiTa/subscribers","subscription_url":"https://api.github.com/repos/josenavas/QiiTa/subscription","commits_url":"https://api.github.com/repos/josenavas/QiiTa/commits{/sha}","git_commits_url":"https://api.github.com/repos/josenavas/QiiTa/git/commits{/sha}","comments_url":"https://api.github.com/repos/josenavas/QiiTa/comments{/number}","issue_comment_url":"https://api.github.com/repos/josenavas/QiiTa/issues/comments/{number}","contents_url":"https://api.github.com/repos/josenavas/QiiTa/contents/{+path}","compare_url":"https://api.github.com/repos/josenavas/QiiTa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/josenavas/QiiTa/merges","archive_url":"https://api.github.com/repos/josenavas/QiiTa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/josenavas/QiiTa/downloads","issues_url":"https://api.github.com/repos/josenavas/QiiTa/issues{/number}","pulls_url":"https://api.github.com/repos/josenavas/QiiTa/pulls{/number}","milestones_url":"https://api.github.com/repos/josenavas/QiiTa/milestones{/number}","notifications_url":"https://api.github.com/repos/josenavas/QiiTa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/josenavas/QiiTa/labels{/name}","releases_url":"https://api.github.com/repos/josenavas/QiiTa/releases{/id}","created_at":"2013-10-12T19:29:32Z","updated_at":"2015-02-13T18:45:02Z","pushed_at":"2015-02-13T18:45:02Z","git_url":"git://github.com/josenavas/QiiTa.git","ssh_url":"git@github.com:josenavas/QiiTa.git","clone_url":"https://github.com/josenavas/QiiTa.git","svn_url":"https://github.com/josenavas/QiiTa","homepage":null,"size":115167,"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":"559556e3dfa315d171553f7beca715cc0b73bca9","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-13T20:19:32Z","pushed_at":"2015-02-13T20:19:32Z","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":118095,"stargazers_count":13,"watchers_count":13,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":181,"forks":13,"open_issues":181,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/biocore/qiita/pulls/837"},"html":{"href":"https://github.com/biocore/qiita/pull/837"},"issue":{"href":"https://api.github.com/repos/biocore/qiita/issues/837"},"comments":{"href":"https://api.github.com/repos/biocore/qiita/issues/837/comments"},"review_comments":{"href":"https://api.github.com/repos/biocore/qiita/pulls/837/comments"},"review_comment":{"href":"https://api.github.com/repos/biocore/qiita/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/biocore/qiita/pulls/837/commits"},"statuses":{"href":"https://api.github.com/repos/biocore/qiita/statuses/4ca81fd3b4f7c9d042fcaceffa0ebf6be85b1423"}}}}