Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blacken unit tests. #7960

Merged
merged 1 commit into from
May 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions bigquery/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-04-03T23:38:10.307198Z",
"updateTime": "2019-05-14T12:12:11.320300Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.23",
"dockerImage": "googleapis/artman@sha256:f3a3f88000dc1cd1b4826104c5574aa5c534f6793fbf66e888d11c0d7ef5762e"
"version": "0.19.0",
"dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e"
}
},
{
"git": {
"name": "googleapis",
"remote": "git@github.com:googleapis/googleapis.git",
"sha": "04193ea2f8121388c998ab49c382f2c03417dcce",
"internalRef": "241828309"
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "ffa256646fb15c4a6c720f0ed8f984a0ea513416",
"internalRef": "248066377"
}
}
],
Expand Down
19 changes: 11 additions & 8 deletions bigquery/tests/unit/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1960,7 +1960,8 @@ def test_to_dataframe_w_bqstorage_multiple_streams_return_unique_index(self):
session.avro_schema.schema = json.dumps({"fields": [{"name": "colA"}]})

bqstorage_client = mock.create_autospec(
bigquery_storage_v1beta1.BigQueryStorageClient)
bigquery_storage_v1beta1.BigQueryStorageClient
)
bqstorage_client.create_read_session.return_value = session

mock_rowstream = mock.create_autospec(reader.ReadRowsStream)
Expand All @@ -1970,7 +1971,8 @@ def test_to_dataframe_w_bqstorage_multiple_streams_return_unique_index(self):
mock_rowstream.rows.return_value = mock_rows

page_data_frame = pandas.DataFrame(
[{"colA": 1}, {"colA": -1}], columns=["colA"])
[{"colA": 1}, {"colA": -1}], columns=["colA"]
)
mock_page = mock.create_autospec(reader.ReadRowsPage)
mock_page.to_dataframe.return_value = page_data_frame
mock_pages = (mock_page, mock_page, mock_page)
Expand Down Expand Up @@ -2184,14 +2186,15 @@ def test_to_dataframe_w_bqstorage_fallback_to_tabledata_list(self):
self.assertEqual(df.age.dtype.name, "int64")

@unittest.skipIf(pandas is None, "Requires `pandas`")
@mock.patch("google.cloud.bigquery.table.RowIterator.pages",
new_callable=mock.PropertyMock)
def test_to_dataframe_tabledata_list_w_multiple_pages_return_unique_index(self, mock_pages):
@mock.patch(
"google.cloud.bigquery.table.RowIterator.pages", new_callable=mock.PropertyMock
)
def test_to_dataframe_tabledata_list_w_multiple_pages_return_unique_index(
self, mock_pages
):
from google.cloud.bigquery import schema

iterator_schema = [
schema.SchemaField("name", "STRING", mode="REQUIRED"),
]
iterator_schema = [schema.SchemaField("name", "STRING", mode="REQUIRED")]
pages = [[{"name": "Bengt"}], [{"name": "Sven"}]]

mock_pages.return_value = pages
Expand Down