When attempting to grant pandas access to my GBQ project, I am running into an issue where read_gbq
is trying to get default credentials, failing / timing out, then printing out a URL to go to to grant the credentials. Since I'm not running this on google cloud platform, I do not expect to be able to get default credentials. In my case, I only want to run the CLI flow (without having oauth call back to my local server).
>>> import pandas_gbq as gbq
>>> gbq.read_gbq('SELECT 1', project_id=<project_id>, auth_local_webserver=False)
File "/usr/lib/python3.5/site-packages/pandas_gbq/gbq.py", line 214, in get_credentials
credentials = self.get_application_default_credentials()
File "/usr/lib/python3.5/site-packages/pandas_gbq/gbq.py", line 243, in get_application_default_credentials
credentials, _ = google.auth.default(scopes=[self.scope])
File "/usr/lib/python3.5/site-packages/google/auth/_default.py", line 277, in default
credentials, project_id = checker()
File "/usr/lib/python3.5/site-packages/google/auth/_default.py", line 274, in <lambda>
lambda: _get_gce_credentials(request))
File "/usr/lib/python3.5/site-packages/google/auth/_default.py", line 176, in _get_gce_credentials
if _metadata.ping(request=request):
File "/usr/lib/python3.5/site-packages/google/auth/compute_engine/_metadata.py", line 73, in ping
timeout=timeout)
File "/usr/lib/python3.5/site-packages/google/auth/transport/_http_client.py", line 103, in __call__
method, path, body=body, headers=headers, **kwargs)
File "/usr/lib/python3.5/http/client.py", line 1106, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.5/socket.py", line 702, in create_connection
sock.connect(sa)
KeyboardInterrupt