Skip to content

Commit 17f4740

Browse files
committed
Issue pandas-dev#13577 - flake8 fixes
1 parent 9ec2a68 commit 17f4740

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pandas/io/gbq.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ def get_application_default_credentials(self):
179179
return None
180180
# Check if the application has rights to the BigQuery project
181181
bigquery_service = build('bigquery', 'v2', credentials=credentials)
182-
job_collection = bigquery_service.jobs()
182+
jobs = bigquery_service.jobs()
183183
job_data = {'configuration': {'query': {'query': 'SELECT 1'}}}
184184
try:
185-
job_collection.insert(projectId=self.project_id, body=job_data).execute()
185+
jobs.insert(projectId=self.project_id, body=job_data).execute()
186186
except (AccessTokenRefreshError, HttpError):
187187
return None
188188
return credentials

pandas/io/tests/test_gbq.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def _test_imports():
8383
from oauth2client.client import GoogleCredentials # noqa
8484
from oauth2client.client import OAuth2WebServerFlow # noqa
8585
from oauth2client.client import AccessTokenRefreshError # noqa
86-
from oauth2client.client import ApplicationDefaultCredentialsError # noqa
86+
from oauth2client.client import ApplicationDefaultCredentialsError # noqa
8787

8888
from oauth2client.file import Storage # noqa
8989
from oauth2client.tools import run_flow # noqa
@@ -219,10 +219,11 @@ def test_should_be_able_to_get_results_from_query(self):
219219
schema, pages = self.sut.run_query('SELECT 1')
220220
self.assertTrue(pages is not None)
221221

222-
def test_should_be_able_to_get_a_bigquery_service_from_default_credentials(self):
222+
def test_should_be_able_to_get_credentials_from_default_credentials(self):
223223
from oauth2client.client import GoogleCredentials
224224
credentials = self.sut.get_application_default_credentials()
225-
self.assertTrue(isinstance(credentials, (type(None), GoogleCredentials)))
225+
valid_types = (type(None), GoogleCredentials)
226+
self.assertTrue(isinstance(credentials, valid_types))
226227

227228

228229
class TestGBQConnectorServiceAccountKeyPathIntegration(tm.TestCase):

0 commit comments

Comments
 (0)