{"action":"created","comment":{"url":"https://api.github.com/repos/hadley/bigrquery/pulls/comments/29357353","id":29357353,"diff_hunk":"@@ -1,30 +1,47 @@\n base_url <- \"https://www.googleapis.com/bigquery/v2/\"\n upload_url <- \"https://www.googleapis.com/upload/bigquery/v2/\"\n \n+prepare_bq_query <- function(query) {\n+  api_key <- Sys.getenv(\"BIGRQUERY_API_KEY\")\n+  if (nzchar(api_key)) {","path":"R/request.r","position":null,"original_position":6,"commit_id":"b4a302abdb2f7a7e461965282f99a204c680df54","original_commit_id":"732b42f6ff99bf2179fa2098ab5101f9025f4629","user":{"login":"craigcitro","id":468559,"avatar_url":"https://avatars.githubusercontent.com/u/468559?v=3","gravatar_id":"","url":"https://api.github.com/users/craigcitro","html_url":"https://github.com/craigcitro","followers_url":"https://api.github.com/users/craigcitro/followers","following_url":"https://api.github.com/users/craigcitro/following{/other_user}","gists_url":"https://api.github.com/users/craigcitro/gists{/gist_id}","starred_url":"https://api.github.com/users/craigcitro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigcitro/subscriptions","organizations_url":"https://api.github.com/users/craigcitro/orgs","repos_url":"https://api.github.com/users/craigcitro/repos","events_url":"https://api.github.com/users/craigcitro/events{/privacy}","received_events_url":"https://api.github.com/users/craigcitro/received_events","type":"User","site_admin":false},"body":"done -- in fact, shortened a good bit when i remembered `%||%`.\r\n\r\nfeel free to spot more niggles. :smirk: ","created_at":"2015-04-29T17:10:44Z","updated_at":"2015-04-29T17:10:44Z","html_url":"https://github.com/hadley/bigrquery/pull/49#discussion_r29357353","pull_request_url":"https://api.github.com/repos/hadley/bigrquery/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/hadley/bigrquery/pulls/comments/29357353"},"html":{"href":"https://github.com/hadley/bigrquery/pull/49#discussion_r29357353"},"pull_request":{"href":"https://api.github.com/repos/hadley/bigrquery/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/hadley/bigrquery/pulls/49","id":34372679,"html_url":"https://github.com/hadley/bigrquery/pull/49","diff_url":"https://github.com/hadley/bigrquery/pull/49.diff","patch_url":"https://github.com/hadley/bigrquery/pull/49.patch","issue_url":"https://api.github.com/repos/hadley/bigrquery/issues/49","number":49,"state":"open","locked":false,"title":"Add support for reading API keys from an env var.","user":{"login":"craigcitro","id":468559,"avatar_url":"https://avatars.githubusercontent.com/u/468559?v=3","gravatar_id":"","url":"https://api.github.com/users/craigcitro","html_url":"https://github.com/craigcitro","followers_url":"https://api.github.com/users/craigcitro/followers","following_url":"https://api.github.com/users/craigcitro/following{/other_user}","gists_url":"https://api.github.com/users/craigcitro/gists{/gist_id}","starred_url":"https://api.github.com/users/craigcitro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigcitro/subscriptions","organizations_url":"https://api.github.com/users/craigcitro/orgs","repos_url":"https://api.github.com/users/craigcitro/repos","events_url":"https://api.github.com/users/craigcitro/events{/privacy}","received_events_url":"https://api.github.com/users/craigcitro/received_events","type":"User","site_admin":false},"body":"This adds support for API keys to bigrquery, reading them from the\r\n`BIGRQUERY_API_KEY` environment variable. They're used in all API calls when\r\npresent.\r\n\r\nPTAL @hadley ","created_at":"2015-04-29T15:09:25Z","updated_at":"2015-04-29T17:10:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5918d474ad1222db7ead15fa87e2b845cc6837e0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hadley/bigrquery/pulls/49/commits","review_comments_url":"https://api.github.com/repos/hadley/bigrquery/pulls/49/comments","review_comment_url":"https://api.github.com/repos/hadley/bigrquery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hadley/bigrquery/issues/49/comments","statuses_url":"https://api.github.com/repos/hadley/bigrquery/statuses/b4a302abdb2f7a7e461965282f99a204c680df54","head":{"label":"craigcitro:api_keys","ref":"api_keys","sha":"b4a302abdb2f7a7e461965282f99a204c680df54","user":{"login":"craigcitro","id":468559,"avatar_url":"https://avatars.githubusercontent.com/u/468559?v=3","gravatar_id":"","url":"https://api.github.com/users/craigcitro","html_url":"https://github.com/craigcitro","followers_url":"https://api.github.com/users/craigcitro/followers","following_url":"https://api.github.com/users/craigcitro/following{/other_user}","gists_url":"https://api.github.com/users/craigcitro/gists{/gist_id}","starred_url":"https://api.github.com/users/craigcitro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigcitro/subscriptions","organizations_url":"https://api.github.com/users/craigcitro/orgs","repos_url":"https://api.github.com/users/craigcitro/repos","events_url":"https://api.github.com/users/craigcitro/events{/privacy}","received_events_url":"https://api.github.com/users/craigcitro/received_events","type":"User","site_admin":false},"repo":{"id":10286198,"name":"bigrquery","full_name":"craigcitro/bigrquery","owner":{"login":"craigcitro","id":468559,"avatar_url":"https://avatars.githubusercontent.com/u/468559?v=3","gravatar_id":"","url":"https://api.github.com/users/craigcitro","html_url":"https://github.com/craigcitro","followers_url":"https://api.github.com/users/craigcitro/followers","following_url":"https://api.github.com/users/craigcitro/following{/other_user}","gists_url":"https://api.github.com/users/craigcitro/gists{/gist_id}","starred_url":"https://api.github.com/users/craigcitro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craigcitro/subscriptions","organizations_url":"https://api.github.com/users/craigcitro/orgs","repos_url":"https://api.github.com/users/craigcitro/repos","events_url":"https://api.github.com/users/craigcitro/events{/privacy}","received_events_url":"https://api.github.com/users/craigcitro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/craigcitro/bigrquery","description":"An interface to Google's bigquery from R.","fork":true,"url":"https://api.github.com/repos/craigcitro/bigrquery","forks_url":"https://api.github.com/repos/craigcitro/bigrquery/forks","keys_url":"https://api.github.com/repos/craigcitro/bigrquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/craigcitro/bigrquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/craigcitro/bigrquery/teams","hooks_url":"https://api.github.com/repos/craigcitro/bigrquery/hooks","issue_events_url":"https://api.github.com/repos/craigcitro/bigrquery/issues/events{/number}","events_url":"https://api.github.com/repos/craigcitro/bigrquery/events","assignees_url":"https://api.github.com/repos/craigcitro/bigrquery/assignees{/user}","branches_url":"https://api.github.com/repos/craigcitro/bigrquery/branches{/branch}","tags_url":"https://api.github.com/repos/craigcitro/bigrquery/tags","blobs_url":"https://api.github.com/repos/craigcitro/bigrquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/craigcitro/bigrquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/craigcitro/bigrquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/craigcitro/bigrquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/craigcitro/bigrquery/statuses/{sha}","languages_url":"https://api.github.com/repos/craigcitro/bigrquery/languages","stargazers_url":"https://api.github.com/repos/craigcitro/bigrquery/stargazers","contributors_url":"https://api.github.com/repos/craigcitro/bigrquery/contributors","subscribers_url":"https://api.github.com/repos/craigcitro/bigrquery/subscribers","subscription_url":"https://api.github.com/repos/craigcitro/bigrquery/subscription","commits_url":"https://api.github.com/repos/craigcitro/bigrquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/craigcitro/bigrquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/craigcitro/bigrquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/craigcitro/bigrquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/craigcitro/bigrquery/contents/{+path}","compare_url":"https://api.github.com/repos/craigcitro/bigrquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/craigcitro/bigrquery/merges","archive_url":"https://api.github.com/repos/craigcitro/bigrquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/craigcitro/bigrquery/downloads","issues_url":"https://api.github.com/repos/craigcitro/bigrquery/issues{/number}","pulls_url":"https://api.github.com/repos/craigcitro/bigrquery/pulls{/number}","milestones_url":"https://api.github.com/repos/craigcitro/bigrquery/milestones{/number}","notifications_url":"https://api.github.com/repos/craigcitro/bigrquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/craigcitro/bigrquery/labels{/name}","releases_url":"https://api.github.com/repos/craigcitro/bigrquery/releases{/id}","created_at":"2013-05-25T15:50:30Z","updated_at":"2015-04-02T18:05:47Z","pushed_at":"2015-04-29T17:09:52Z","git_url":"git://github.com/craigcitro/bigrquery.git","ssh_url":"git@github.com:craigcitro/bigrquery.git","clone_url":"https://github.com/craigcitro/bigrquery.git","svn_url":"https://github.com/craigcitro/bigrquery","homepage":null,"size":378,"stargazers_count":0,"watchers_count":0,"language":"R","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":"hadley:master","ref":"master","sha":"43c24dc3272cb56900982a610efd73874db4b73f","user":{"login":"hadley","id":4196,"avatar_url":"https://avatars.githubusercontent.com/u/4196?v=3","gravatar_id":"","url":"https://api.github.com/users/hadley","html_url":"https://github.com/hadley","followers_url":"https://api.github.com/users/hadley/followers","following_url":"https://api.github.com/users/hadley/following{/other_user}","gists_url":"https://api.github.com/users/hadley/gists{/gist_id}","starred_url":"https://api.github.com/users/hadley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadley/subscriptions","organizations_url":"https://api.github.com/users/hadley/orgs","repos_url":"https://api.github.com/users/hadley/repos","events_url":"https://api.github.com/users/hadley/events{/privacy}","received_events_url":"https://api.github.com/users/hadley/received_events","type":"User","site_admin":false},"repo":{"id":10221246,"name":"bigrquery","full_name":"hadley/bigrquery","owner":{"login":"hadley","id":4196,"avatar_url":"https://avatars.githubusercontent.com/u/4196?v=3","gravatar_id":"","url":"https://api.github.com/users/hadley","html_url":"https://github.com/hadley","followers_url":"https://api.github.com/users/hadley/followers","following_url":"https://api.github.com/users/hadley/following{/other_user}","gists_url":"https://api.github.com/users/hadley/gists{/gist_id}","starred_url":"https://api.github.com/users/hadley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadley/subscriptions","organizations_url":"https://api.github.com/users/hadley/orgs","repos_url":"https://api.github.com/users/hadley/repos","events_url":"https://api.github.com/users/hadley/events{/privacy}","received_events_url":"https://api.github.com/users/hadley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hadley/bigrquery","description":"An interface to Google's bigquery from R.","fork":false,"url":"https://api.github.com/repos/hadley/bigrquery","forks_url":"https://api.github.com/repos/hadley/bigrquery/forks","keys_url":"https://api.github.com/repos/hadley/bigrquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hadley/bigrquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hadley/bigrquery/teams","hooks_url":"https://api.github.com/repos/hadley/bigrquery/hooks","issue_events_url":"https://api.github.com/repos/hadley/bigrquery/issues/events{/number}","events_url":"https://api.github.com/repos/hadley/bigrquery/events","assignees_url":"https://api.github.com/repos/hadley/bigrquery/assignees{/user}","branches_url":"https://api.github.com/repos/hadley/bigrquery/branches{/branch}","tags_url":"https://api.github.com/repos/hadley/bigrquery/tags","blobs_url":"https://api.github.com/repos/hadley/bigrquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hadley/bigrquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hadley/bigrquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/hadley/bigrquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hadley/bigrquery/statuses/{sha}","languages_url":"https://api.github.com/repos/hadley/bigrquery/languages","stargazers_url":"https://api.github.com/repos/hadley/bigrquery/stargazers","contributors_url":"https://api.github.com/repos/hadley/bigrquery/contributors","subscribers_url":"https://api.github.com/repos/hadley/bigrquery/subscribers","subscription_url":"https://api.github.com/repos/hadley/bigrquery/subscription","commits_url":"https://api.github.com/repos/hadley/bigrquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/hadley/bigrquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/hadley/bigrquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/hadley/bigrquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/hadley/bigrquery/contents/{+path}","compare_url":"https://api.github.com/repos/hadley/bigrquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hadley/bigrquery/merges","archive_url":"https://api.github.com/repos/hadley/bigrquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hadley/bigrquery/downloads","issues_url":"https://api.github.com/repos/hadley/bigrquery/issues{/number}","pulls_url":"https://api.github.com/repos/hadley/bigrquery/pulls{/number}","milestones_url":"https://api.github.com/repos/hadley/bigrquery/milestones{/number}","notifications_url":"https://api.github.com/repos/hadley/bigrquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hadley/bigrquery/labels{/name}","releases_url":"https://api.github.com/repos/hadley/bigrquery/releases{/id}","created_at":"2013-05-22T14:04:16Z","updated_at":"2015-04-28T05:24:04Z","pushed_at":"2015-04-29T17:09:53Z","git_url":"git://github.com/hadley/bigrquery.git","ssh_url":"git@github.com:hadley/bigrquery.git","clone_url":"https://github.com/hadley/bigrquery.git","svn_url":"https://github.com/hadley/bigrquery","homepage":null,"size":758,"stargazers_count":86,"watchers_count":86,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":13,"forks":35,"open_issues":13,"watchers":86,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hadley/bigrquery/pulls/49"},"html":{"href":"https://github.com/hadley/bigrquery/pull/49"},"issue":{"href":"https://api.github.com/repos/hadley/bigrquery/issues/49"},"comments":{"href":"https://api.github.com/repos/hadley/bigrquery/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/hadley/bigrquery/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/hadley/bigrquery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hadley/bigrquery/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/hadley/bigrquery/statuses/b4a302abdb2f7a7e461965282f99a204c680df54"}}}}