{"action":"created","comment":{"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/comments/167915243","pull_request_review_id":96200408,"id":167915243,"diff_hunk":"@@ -217,19 +215,18 @@ def get_sum_and_count_aggregation_results(keyword):\n                  }\n               }\n               }, \"size\": 0}\n-    found_result = 0\n-    while not found_result > 10:\n-        found_result += 1\n+    response = es_client_query(index=index_name, body=query, retries=10)\n+    if response:\n         try:\n-            response = CLIENT.search(index=index_name, body=query)\n             results = {}\n             results[\"prime_awards_count\"] = response['aggregations'][\"prime_awards_count\"][\"value\"]\n             results[\"prime_awards_obligation_amount\"] = \\\n                 round(response['aggregations'][\"prime_awards_obligation_amount\"][\"value\"], 2)\n             return results\n-        except (TransportError, ConnectionError) as e:\n-            logger.error(e)\n-            logger.error('Error retrieving ids. Retrying connection.')\n+        except KeyError:\n+            logger.error('Unexpected Response')\n+    else:\n+        return None","path":"usaspending_api/search/v2/elasticsearch_helper.py","position":38,"original_position":38,"commit_id":"fdeb13297e15d33ff2b692d88aad1e36558dccea","original_commit_id":"fdeb13297e15d33ff2b692d88aad1e36558dccea","user":{"login":"tony-sappe","id":22781949,"avatar_url":"https://avatars1.githubusercontent.com/u/22781949?v=4","gravatar_id":"","url":"https://api.github.com/users/tony-sappe","html_url":"https://github.com/tony-sappe","followers_url":"https://api.github.com/users/tony-sappe/followers","following_url":"https://api.github.com/users/tony-sappe/following{/other_user}","gists_url":"https://api.github.com/users/tony-sappe/gists{/gist_id}","starred_url":"https://api.github.com/users/tony-sappe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tony-sappe/subscriptions","organizations_url":"https://api.github.com/users/tony-sappe/orgs","repos_url":"https://api.github.com/users/tony-sappe/repos","events_url":"https://api.github.com/users/tony-sappe/events{/privacy}","received_events_url":"https://api.github.com/users/tony-sappe/received_events","type":"User","site_admin":false},"body":"There should be a check in search.py to handle this return value and provide the correct exception","created_at":"2018-02-13T16:12:00Z","updated_at":"2018-02-13T16:12:00Z","html_url":"https://github.com/fedspendingtransparency/usaspending-api/pull/973#discussion_r167915243","pull_request_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/973","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/comments/167915243"},"html":{"href":"https://github.com/fedspendingtransparency/usaspending-api/pull/973#discussion_r167915243"},"pull_request":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/973"}}},"pull_request":{"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/973","id":168628412,"html_url":"https://github.com/fedspendingtransparency/usaspending-api/pull/973","diff_url":"https://github.com/fedspendingtransparency/usaspending-api/pull/973.diff","patch_url":"https://github.com/fedspendingtransparency/usaspending-api/pull/973.patch","issue_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/973","number":973,"state":"open","locked":false,"title":"refactoring","user":{"login":"MelvinDunn","id":12663957,"avatar_url":"https://avatars0.githubusercontent.com/u/12663957?v=4","gravatar_id":"","url":"https://api.github.com/users/MelvinDunn","html_url":"https://github.com/MelvinDunn","followers_url":"https://api.github.com/users/MelvinDunn/followers","following_url":"https://api.github.com/users/MelvinDunn/following{/other_user}","gists_url":"https://api.github.com/users/MelvinDunn/gists{/gist_id}","starred_url":"https://api.github.com/users/MelvinDunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MelvinDunn/subscriptions","organizations_url":"https://api.github.com/users/MelvinDunn/orgs","repos_url":"https://api.github.com/users/MelvinDunn/repos","events_url":"https://api.github.com/users/MelvinDunn/events{/privacy}","received_events_url":"https://api.github.com/users/MelvinDunn/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-12T16:39:01Z","updated_at":"2018-02-13T16:12:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d521cedafcf29172a4984dec7da0e9e0d8d08c0","assignee":{"login":"tony-sappe","id":22781949,"avatar_url":"https://avatars1.githubusercontent.com/u/22781949?v=4","gravatar_id":"","url":"https://api.github.com/users/tony-sappe","html_url":"https://github.com/tony-sappe","followers_url":"https://api.github.com/users/tony-sappe/followers","following_url":"https://api.github.com/users/tony-sappe/following{/other_user}","gists_url":"https://api.github.com/users/tony-sappe/gists{/gist_id}","starred_url":"https://api.github.com/users/tony-sappe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tony-sappe/subscriptions","organizations_url":"https://api.github.com/users/tony-sappe/orgs","repos_url":"https://api.github.com/users/tony-sappe/repos","events_url":"https://api.github.com/users/tony-sappe/events{/privacy}","received_events_url":"https://api.github.com/users/tony-sappe/received_events","type":"User","site_admin":false},"assignees":[{"login":"tony-sappe","id":22781949,"avatar_url":"https://avatars1.githubusercontent.com/u/22781949?v=4","gravatar_id":"","url":"https://api.github.com/users/tony-sappe","html_url":"https://github.com/tony-sappe","followers_url":"https://api.github.com/users/tony-sappe/followers","following_url":"https://api.github.com/users/tony-sappe/following{/other_user}","gists_url":"https://api.github.com/users/tony-sappe/gists{/gist_id}","starred_url":"https://api.github.com/users/tony-sappe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tony-sappe/subscriptions","organizations_url":"https://api.github.com/users/tony-sappe/orgs","repos_url":"https://api.github.com/users/tony-sappe/repos","events_url":"https://api.github.com/users/tony-sappe/events{/privacy}","received_events_url":"https://api.github.com/users/tony-sappe/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":690683541,"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/labels/do%20not%20merge","name":"do not merge","color":"ee0701","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/973/commits","review_comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/973/comments","review_comment_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/973/comments","statuses_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/statuses/fdeb13297e15d33ff2b692d88aad1e36558dccea","head":{"label":"fedspendingtransparency:feature-es-helper-refactor","ref":"feature-es-helper-refactor","sha":"fdeb13297e15d33ff2b692d88aad1e36558dccea","user":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars0.githubusercontent.com/u/8397762?v=4","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":65394827,"name":"usaspending-api","full_name":"fedspendingtransparency/usaspending-api","owner":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars0.githubusercontent.com/u/8397762?v=4","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/usaspending-api","description":"An RESTful API for U.S. federal spending data.","fork":false,"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api","forks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/forks","keys_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/teams","hooks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/hooks","issue_events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/events{/number}","events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/events","assignees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/assignees{/user}","branches_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/branches{/branch}","tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/tags","blobs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/statuses/{sha}","languages_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/languages","stargazers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/stargazers","contributors_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/contributors","subscribers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/subscribers","subscription_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/subscription","commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/contents/{+path}","compare_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/merges","archive_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/downloads","issues_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues{/number}","pulls_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls{/number}","milestones_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/milestones{/number}","notifications_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/labels{/name}","releases_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/releases{/id}","deployments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/deployments","created_at":"2016-08-10T15:39:45Z","updated_at":"2018-01-29T17:30:32Z","pushed_at":"2018-02-13T16:07:10Z","git_url":"git://github.com/fedspendingtransparency/usaspending-api.git","ssh_url":"git@github.com:fedspendingtransparency/usaspending-api.git","clone_url":"https://github.com/fedspendingtransparency/usaspending-api.git","svn_url":"https://github.com/fedspendingtransparency/usaspending-api","homepage":"","size":47958,"stargazers_count":52,"watchers_count":52,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":14,"open_issues":11,"watchers":52,"default_branch":"dev"}},"base":{"label":"fedspendingtransparency:dev","ref":"dev","sha":"a192e637ef0af9f7bdb3c8eb02fa63e0b558315a","user":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars0.githubusercontent.com/u/8397762?v=4","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":65394827,"name":"usaspending-api","full_name":"fedspendingtransparency/usaspending-api","owner":{"login":"fedspendingtransparency","id":8397762,"avatar_url":"https://avatars0.githubusercontent.com/u/8397762?v=4","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/usaspending-api","description":"An RESTful API for U.S. federal spending data.","fork":false,"url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api","forks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/forks","keys_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/teams","hooks_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/hooks","issue_events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/events{/number}","events_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/events","assignees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/assignees{/user}","branches_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/branches{/branch}","tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/tags","blobs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/statuses/{sha}","languages_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/languages","stargazers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/stargazers","contributors_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/contributors","subscribers_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/subscribers","subscription_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/subscription","commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/contents/{+path}","compare_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/merges","archive_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/downloads","issues_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues{/number}","pulls_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls{/number}","milestones_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/milestones{/number}","notifications_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/labels{/name}","releases_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/releases{/id}","deployments_url":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/deployments","created_at":"2016-08-10T15:39:45Z","updated_at":"2018-01-29T17:30:32Z","pushed_at":"2018-02-13T16:07:10Z","git_url":"git://github.com/fedspendingtransparency/usaspending-api.git","ssh_url":"git@github.com:fedspendingtransparency/usaspending-api.git","clone_url":"https://github.com/fedspendingtransparency/usaspending-api.git","svn_url":"https://github.com/fedspendingtransparency/usaspending-api","homepage":"","size":47958,"stargazers_count":52,"watchers_count":52,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":11,"license":null,"forks":14,"open_issues":11,"watchers":52,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/973"},"html":{"href":"https://github.com/fedspendingtransparency/usaspending-api/pull/973"},"issue":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/973"},"comments":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/issues/973/comments"},"review_comments":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/973/comments"},"review_comment":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/pulls/973/commits"},"statuses":{"href":"https://api.github.com/repos/fedspendingtransparency/usaspending-api/statuses/fdeb13297e15d33ff2b692d88aad1e36558dccea"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"tony-sappe"}}