Skip to content

Commit 321d747

Browse files
authored
BigQuery Storage: run 'blacken' during synth (googleapis#7047)
Also, pick up stub docstring fix in GAPIC generator. Closes googleapis#6878.
1 parent af3df9c commit 321d747

4 files changed

Lines changed: 54 additions & 5 deletions

File tree

bigquery_storage/google/cloud/bigquery_storage_v1beta1/gapic/transports/big_query_storage_grpc_transport.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def channel(self):
105105

106106
@property
107107
def create_read_session(self):
108-
"""Return the gRPC stub for {$apiMethod.name}.
108+
"""Return the gRPC stub for :meth:`BigQueryStorageClient.create_read_session`.
109109
110110
Creates a new read session. A read session divides the contents of a
111111
BigQuery table into one or more streams, which can then be used to read
@@ -129,7 +129,7 @@ def create_read_session(self):
129129

130130
@property
131131
def read_rows(self):
132-
"""Return the gRPC stub for {$apiMethod.name}.
132+
"""Return the gRPC stub for :meth:`BigQueryStorageClient.read_rows`.
133133
134134
Reads rows from the table in the format prescribed by the read session.
135135
Each response contains one or more table rows, up to a maximum of 10 MiB
@@ -150,7 +150,7 @@ def read_rows(self):
150150

151151
@property
152152
def batch_create_read_session_streams(self):
153-
"""Return the gRPC stub for {$apiMethod.name}.
153+
"""Return the gRPC stub for :meth:`BigQueryStorageClient.batch_create_read_session_streams`.
154154
155155
Creates additional streams for a ReadSession. This API can be used to
156156
dynamically adjust the parallelism of a batch processing task upwards by
@@ -165,7 +165,7 @@ def batch_create_read_session_streams(self):
165165

166166
@property
167167
def finalize_stream(self):
168-
"""Return the gRPC stub for {$apiMethod.name}.
168+
"""Return the gRPC stub for :meth:`BigQueryStorageClient.finalize_stream`.
169169
170170
Triggers the graceful termination of a single stream in a ReadSession. This
171171
API can be used to dynamically adjust the parallelism of a batch processing
@@ -191,7 +191,7 @@ def finalize_stream(self):
191191

192192
@property
193193
def split_read_stream(self):
194-
"""Return the gRPC stub for {$apiMethod.name}.
194+
"""Return the gRPC stub for :meth:`BigQueryStorageClient.split_read_stream`.
195195
196196
Splits a given read stream into two Streams. These streams are referred
197197
to as the primary and the residual of the split. The original stream can

bigquery_storage/noxfile.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@ def lint(session):
7474
session.run('flake8', 'tests')
7575

7676

77+
@nox.session(python="3.6")
78+
def blacken(session):
79+
"""Run black.
80+
81+
Format code to uniform standard.
82+
"""
83+
session.install("black")
84+
session.run(
85+
"black",
86+
"google",
87+
"tests",
88+
"docs",
89+
)
90+
91+
7792
@nox.session(python='3.6')
7893
def lint_setup_py(session):
7994
"""Verify that setup.py is valid (including RST check)."""

bigquery_storage/synth.metadata

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"updateTime": "2019-01-04T19:40:42.544142Z",
3+
"sources": [
4+
{
5+
"generator": {
6+
"name": "artman",
7+
"version": "0.16.4",
8+
"dockerImage": "googleapis/artman@sha256:8b45fae963557c3299921037ecbb86f0689f41b1b4aea73408ebc50562cb2857"
9+
}
10+
},
11+
{
12+
"git": {
13+
"name": "googleapis",
14+
"remote": "https://github.com/googleapis/googleapis.git",
15+
"sha": "c050b8885af23bfbc4e2858858db47e33e311da7",
16+
"internalRef": "227870263"
17+
}
18+
}
19+
],
20+
"destinations": [
21+
{
22+
"client": {
23+
"source": "googleapis",
24+
"apiName": "bigquery-datatransfer",
25+
"apiVersion": "v1",
26+
"language": "python",
27+
"generator": "gapic",
28+
"config": "google/cloud/bigquery/storage/artman_bigquerystorage_v1beta1.yaml"
29+
}
30+
}
31+
]
32+
}

bigquery_storage/synth.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,5 @@
111111
'google.api_core.grpc_helpers.create_channel( # pragma: no cover',
112112
)
113113
# END: Ignore lint and coverage
114+
115+
s.shell.run(["nox", "-s", "blacken"], hide_output=False)

0 commit comments

Comments
 (0)