{"action":"created","comment":{"url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls/comments/83903967","pull_request_review_id":4710059,"id":83903967,"diff_hunk":"@@ -1,14 +1,22 @@\n-SELECT afa.row_number, afa.fain, afa.uri\n+SELECT DISTINCT afa.row_number, afa.fain, afa.uri\n FROM award_financial_assistance AS afa\n WHERE afa.submission_id = {0}\n-\tAND CAST(afa.federal_action_obligation as numeric) > 0\n-\tAND afa.row_number NOT IN (\n-\t\tSELECT afa.row_number\n-\t\tFROM award_financial_assistance AS afa\n-\t\t\tJOIN award_financial AS af\n-\t\t\t\tON (afa.fain IS NOT DISTINCT FROM af.fain\n-\t\t\t\tAND afa.uri IS NOT DISTINCT FROM af.uri\n-\t\t\t\tAND afa.submission_id = af.submission_id)\n-\t\tWHERE CAST(afa.federal_action_obligation as numeric) > 0\n-\t\t\tAND afa.submission_id = {0}\n-\t);\n\\ No newline at end of file\n+    AND COALESCE(CAST(afa.federal_action_obligation as numeric),0) <> 0\n+    AND COALESCE(CAST(afa.original_loan_subsidy_cost as numeric),0) <> 0\n+    AND (\n+        afa.row_number NOT IN (\n+            SELECT afa.row_number\n+            FROM award_financial_assistance AS afa\n+                JOIN award_financial AS af\n+                    ON (afa.submission_id = af.submission_id\n+                        AND (afa.fain IS NOT DISTINCT FROM af.fain\n+                            AND afa.uri IS NOT DISTINCT FROM af.uri)\n+                    )\n+            WHERE COALESCE(CAST(afa.federal_action_obligation as numeric),0) <> 0\n+                AND COALESCE(CAST(afa.original_loan_subsidy_cost as numeric),0) <> 0\n+                AND afa.submission_id = {0}\n+        ) OR (\n+            afa.fain IS NOT NULL\n+            AND afa.uri IS NOT NULL","path":"dataactvalidator/config/sqlrules/c9_award_financial.sql","position":33,"original_position":33,"commit_id":"52a877d140703c241853dd1bdc512f6934750690","original_commit_id":"1d391b8f6b827283ec56e2dde8108b5ef83246f2","user":{"login":"jworcestBAH","id":11858333,"avatar_url":"https://avatars.githubusercontent.com/u/11858333?v=3","gravatar_id":"","url":"https://api.github.com/users/jworcestBAH","html_url":"https://github.com/jworcestBAH","followers_url":"https://api.github.com/users/jworcestBAH/followers","following_url":"https://api.github.com/users/jworcestBAH/following{/other_user}","gists_url":"https://api.github.com/users/jworcestBAH/gists{/gist_id}","starred_url":"https://api.github.com/users/jworcestBAH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jworcestBAH/subscriptions","organizations_url":"https://api.github.com/users/jworcestBAH/orgs","repos_url":"https://api.github.com/users/jworcestBAH/repos","events_url":"https://api.github.com/users/jworcestBAH/events{/privacy}","received_events_url":"https://api.github.com/users/jworcestBAH/received_events","type":"User","site_admin":false},"body":"So after seeing it in the unit test below I realized this check is being done on D2, which we should definitely confirm as I thought the expectation was that D2 can have both and file C should be just one","created_at":"2016-10-18T17:12:59Z","updated_at":"2016-10-18T17:13:43Z","html_url":"https://github.com/fedspendingtransparency/data-act-broker-backend/pull/358#discussion_r83903967","pull_request_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls/358","_links":{"self":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls/comments/83903967"},"html":{"href":"https://github.com/fedspendingtransparency/data-act-broker-backend/pull/358#discussion_r83903967"},"pull_request":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls/358"}}},"pull_request":{"url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls/358","id":89852610,"html_url":"https://github.com/fedspendingtransparency/data-act-broker-backend/pull/358","diff_url":"https://github.com/fedspendingtransparency/data-act-broker-backend/pull/358.diff","patch_url":"https://github.com/fedspendingtransparency/data-act-broker-backend/pull/358.patch","issue_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/issues/358","number":358,"state":"open","locked":false,"title":"Updating C8 and C9 SQL Validations","user":{"login":"mab6bf","id":4449046,"avatar_url":"https://avatars.githubusercontent.com/u/4449046?v=3","gravatar_id":"","url":"https://api.github.com/users/mab6bf","html_url":"https://github.com/mab6bf","followers_url":"https://api.github.com/users/mab6bf/followers","following_url":"https://api.github.com/users/mab6bf/following{/other_user}","gists_url":"https://api.github.com/users/mab6bf/gists{/gist_id}","starred_url":"https://api.github.com/users/mab6bf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mab6bf/subscriptions","organizations_url":"https://api.github.com/users/mab6bf/orgs","repos_url":"https://api.github.com/users/mab6bf/repos","events_url":"https://api.github.com/users/mab6bf/events{/privacy}","received_events_url":"https://api.github.com/users/mab6bf/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-18T16:31:55Z","updated_at":"2016-10-18T17:21:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fed26521854221c169f8d8e9e5decc1b2ab3ea9e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls/358/commits","review_comments_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls/358/comments","review_comment_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/issues/358/comments","statuses_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/statuses/52a877d140703c241853dd1bdc512f6934750690","head":{"label":"fedspendingtransparency:db-774-c8-c9-updates","ref":"db-774-c8-c9-updates","sha":"52a877d140703c241853dd1bdc512f6934750690","user":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"repo":{"id":57313310,"name":"data-act-broker-backend","full_name":"fedspendingtransparency/data-act-broker-backend","owner":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedspendingtransparency/data-act-broker-backend","description":null,"fork":false,"url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend","forks_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/forks","keys_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/teams","hooks_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/hooks","issue_events_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/issues/events{/number}","events_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/events","assignees_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/assignees{/user}","branches_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/branches{/branch}","tags_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/tags","blobs_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/languages","stargazers_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/stargazers","contributors_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/contributors","subscribers_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/subscribers","subscription_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/subscription","commits_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/contents/{+path}","compare_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/merges","archive_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/downloads","issues_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/issues{/number}","pulls_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/labels{/name}","releases_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/releases{/id}","deployments_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/deployments","created_at":"2016-04-28T15:39:36Z","updated_at":"2016-08-30T17:03:39Z","pushed_at":"2016-10-18T17:13:43Z","git_url":"git://github.com/fedspendingtransparency/data-act-broker-backend.git","ssh_url":"git@github.com:fedspendingtransparency/data-act-broker-backend.git","clone_url":"https://github.com/fedspendingtransparency/data-act-broker-backend.git","svn_url":"https://github.com/fedspendingtransparency/data-act-broker-backend","homepage":null,"size":53089,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"fedspendingtransparency:development","ref":"development","sha":"1e91bfbc5a30b71f7a9a81495d3ec716b697f49a","user":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"repo":{"id":57313310,"name":"data-act-broker-backend","full_name":"fedspendingtransparency/data-act-broker-backend","owner":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars.githubusercontent.com/u/8397762?v=3","gravatar_id":"","url":"https://api.github.com/users/fedspendingtransparency","html_url":"https://github.com/fedspendingtransparency","followers_url":"https://api.github.com/users/fedspendingtransparency/followers","following_url":"https://api.github.com/users/fedspendingtransparency/following{/other_user}","gists_url":"https://api.github.com/users/fedspendingtransparency/gists{/gist_id}","starred_url":"https://api.github.com/users/fedspendingtransparency/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fedspendingtransparency/subscriptions","organizations_url":"https://api.github.com/users/fedspendingtransparency/orgs","repos_url":"https://api.github.com/users/fedspendingtransparency/repos","events_url":"https://api.github.com/users/fedspendingtransparency/events{/privacy}","received_events_url":"https://api.github.com/users/fedspendingtransparency/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fedspendingtransparency/data-act-broker-backend","description":null,"fork":false,"url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend","forks_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/forks","keys_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/teams","hooks_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/hooks","issue_events_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/issues/events{/number}","events_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/events","assignees_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/assignees{/user}","branches_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/branches{/branch}","tags_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/tags","blobs_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/languages","stargazers_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/stargazers","contributors_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/contributors","subscribers_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/subscribers","subscription_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/subscription","commits_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/contents/{+path}","compare_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/merges","archive_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/downloads","issues_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/issues{/number}","pulls_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/labels{/name}","releases_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/releases{/id}","deployments_url":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/deployments","created_at":"2016-04-28T15:39:36Z","updated_at":"2016-08-30T17:03:39Z","pushed_at":"2016-10-18T17:13:43Z","git_url":"git://github.com/fedspendingtransparency/data-act-broker-backend.git","ssh_url":"git@github.com:fedspendingtransparency/data-act-broker-backend.git","clone_url":"https://github.com/fedspendingtransparency/data-act-broker-backend.git","svn_url":"https://github.com/fedspendingtransparency/data-act-broker-backend","homepage":null,"size":53089,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":5,"forks":2,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls/358"},"html":{"href":"https://github.com/fedspendingtransparency/data-act-broker-backend/pull/358"},"issue":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/issues/358"},"comments":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/issues/358/comments"},"review_comments":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls/358/comments"},"review_comment":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/pulls/358/commits"},"statuses":{"href":"https://api.github.com/repos/fedspendingtransparency/data-act-broker-backend/statuses/52a877d140703c241853dd1bdc512f6934750690"}}}}
{"actor":{"display_login":"jworcestBAH"}}