Rename query file and use async method. · aroder/python-docs-samples@89c01b8 · GitHub
Skip to content

Commit 89c01b8

Browse files
committed
Rename query file and use async method.
Update to latest version of google-cloud-bigquery.
1 parent 3554dad commit 89c01b8

4 files changed

Lines changed: 89 additions & 49 deletions

File tree

bigquery/cloud-client/sync_query_params.py renamed to bigquery/cloud-client/query_params.py

Lines changed: 65 additions & 33 deletions

bigquery/cloud-client/sync_query_params_test.py renamed to bigquery/cloud-client/query_params_test.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,41 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import sync_query_params
15+
import query_params
1616

1717

18-
def test_sync_query_named_params(capsys):
19-
sync_query_params.sync_query_array_params(
18+
def test_query_array_params(capsys):
19+
query_params.query_array_params(
2020
gender='M',
2121
states=['WA', 'WI', 'WV', 'WY'])
2222
out, _ = capsys.readouterr()
2323
assert 'James' in out
2424

2525

26-
def test_sync_query_positional_params(capsys):
27-
sync_query_params.sync_query_positional_params(
26+
def test_query_named_params(capsys):
27+
query_params.query_named_params(
2828
corpus='romeoandjuliet',
2929
min_word_count=100)
3030
out, _ = capsys.readouterr()
3131
assert 'love' in out
3232

3333

34-
def test_sync_query_struct_params(capsys):
35-
sync_query_params.sync_query_struct_params(765, "hello world")
34+
def test_query_positional_params(capsys):
35+
query_params.query_positional_params(
36+
corpus='romeoandjuliet',
37+
min_word_count=100)
38+
out, _ = capsys.readouterr()
39+
assert 'love' in out
40+
41+
42+
def test_query_struct_params(capsys):
43+
query_params.query_struct_params(765, "hello world")
3644
out, _ = capsys.readouterr()
3745
assert '765' in out
3846
assert 'hello world' in out
3947

4048

41-
def test_sync_query_timestamp_params(capsys):
42-
sync_query_params.sync_query_timestamp_params(2016, 12, 7, 8, 0)
49+
def test_query_timestamp_params(capsys):
50+
query_params.query_timestamp_params(2016, 12, 7, 8, 0)
4351
out, _ = capsys.readouterr()
44-
assert '2016-12-07 09:00:00' in out
52+
assert '2016, 12, 7, 9, 0' in out
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-cloud-bigquery==0.22.1
1+
google-cloud-bigquery==0.24.0
22
pytz==2016.10

scripts/prepare-testing-project.sh

Lines changed: 5 additions & 5 deletions

0 commit comments

Comments
 (0)