Skip to content

Commit 94a93ca

Browse files
committed
CLN: blacken with same version as Stickler
1 parent 0e3e3f0 commit 94a93ca

File tree

6 files changed

+24
-18
lines changed

6 files changed

+24
-18
lines changed

noxfile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
latest_python = "3.8"
1616

1717
# Use a consistent version of black so CI is deterministic.
18-
black_package = "black==19.10b0"
18+
# Should match Stickler: https://stickler-ci.com/docs#black
19+
black_package = "black==20.8b1"
1920

2021

2122
@nox.session

pandas_gbq/auth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def get_credentials(
5151
return credentials, project_id
5252

5353

54-
def get_credentials_cache(reauth,):
54+
def get_credentials_cache(
55+
reauth,
56+
):
5557
import pydata_google_auth.cache
5658

5759
if reauth:

pandas_gbq/gbq.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ def _generate_bq_schema(df, default_type="STRING"):
12381238
issues in the default schema generation. Now that individual columns can
12391239
be overridden: https://github.com/pydata/pandas-gbq/issues/218, this
12401240
method can be removed after there is time to migrate away from this
1241-
method. """
1241+
method."""
12421242
from pandas_gbq import schema
12431243

12441244
return schema.generate_bq_schema(df, default_type=default_type)
@@ -1264,7 +1264,7 @@ def __init__(
12641264
)
12651265

12661266
def exists(self, table_id):
1267-
""" Check if a table exists in Google BigQuery
1267+
"""Check if a table exists in Google BigQuery
12681268
12691269
Parameters
12701270
----------
@@ -1288,7 +1288,7 @@ def exists(self, table_id):
12881288
self.process_http_error(ex)
12891289

12901290
def create(self, table_id, schema):
1291-
""" Create a table in Google BigQuery given a table and schema
1291+
"""Create a table in Google BigQuery given a table and schema
12921292
12931293
Parameters
12941294
----------
@@ -1330,7 +1330,7 @@ def create(self, table_id, schema):
13301330
self.process_http_error(ex)
13311331

13321332
def delete(self, table_id):
1333-
""" Delete a table in Google BigQuery
1333+
"""Delete a table in Google BigQuery
13341334
13351335
Parameters
13361336
----------
@@ -1370,7 +1370,7 @@ def __init__(
13701370
)
13711371

13721372
def exists(self, dataset_id):
1373-
""" Check if a dataset exists in Google BigQuery
1373+
"""Check if a dataset exists in Google BigQuery
13741374
13751375
Parameters
13761376
----------
@@ -1393,7 +1393,7 @@ def exists(self, dataset_id):
13931393
self.process_http_error(ex)
13941394

13951395
def create(self, dataset_id):
1396-
""" Create a dataset in Google BigQuery
1396+
"""Create a dataset in Google BigQuery
13971397
13981398
Parameters
13991399
----------

tests/system/test_read_gbq_with_bqstorage.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ def test_empty_results(method_under_test, query_string):
3030
3131
See: https://github.com/pydata/pandas-gbq/issues/299
3232
"""
33-
df = method_under_test(query_string, use_bqstorage_api=True,)
33+
df = method_under_test(
34+
query_string,
35+
use_bqstorage_api=True,
36+
)
3437
assert len(df.index) == 0
3538

3639

tests/unit/test_gbq.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ def test_to_gbq_doesnt_run_query(
248248
def test_to_gbq_w_empty_df(mock_bigquery_client):
249249
import google.api_core.exceptions
250250

251-
mock_bigquery_client.get_table.side_effect = google.api_core.exceptions.NotFound(
252-
"my_table"
251+
mock_bigquery_client.get_table.side_effect = (
252+
google.api_core.exceptions.NotFound("my_table")
253253
)
254254
gbq.to_gbq(DataFrame(), "my_dataset.my_table", project_id="1234")
255255
mock_bigquery_client.create_table.assert_called_with(mock.ANY)
@@ -260,11 +260,11 @@ def test_to_gbq_w_empty_df(mock_bigquery_client):
260260
def test_to_gbq_creates_dataset(mock_bigquery_client):
261261
import google.api_core.exceptions
262262

263-
mock_bigquery_client.get_table.side_effect = google.api_core.exceptions.NotFound(
264-
"my_table"
263+
mock_bigquery_client.get_table.side_effect = (
264+
google.api_core.exceptions.NotFound("my_table")
265265
)
266-
mock_bigquery_client.get_dataset.side_effect = google.api_core.exceptions.NotFound(
267-
"my_dataset"
266+
mock_bigquery_client.get_dataset.side_effect = (
267+
google.api_core.exceptions.NotFound("my_dataset")
268268
)
269269
gbq.to_gbq(DataFrame([[1]]), "my_dataset.my_table", project_id="1234")
270270
mock_bigquery_client.create_dataset.assert_called_with(mock.ANY)
@@ -375,7 +375,8 @@ def test_read_gbq_with_old_bq_raises_importerror():
375375
) as mock_version:
376376
mock_version.side_effect = [bigquery_version]
377377
gbq.read_gbq(
378-
"SELECT 1", project_id="my-project",
378+
"SELECT 1",
379+
project_id="my-project",
379380
)
380381

381382

tests/unit/test_load.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def test_encode_chunk_with_floats():
3838

3939

4040
def test_encode_chunk_with_newlines():
41-
"""See: https://github.com/pydata/pandas-gbq/issues/180
42-
"""
41+
"""See: https://github.com/pydata/pandas-gbq/issues/180"""
4342
df = pandas.DataFrame({"s": ["abcd", "ef\ngh", "ij\r\nkl"]})
4443
csv_buffer = load.encode_chunk(df)
4544
csv_bytes = csv_buffer.read()

0 commit comments

Comments
 (0)