@@ -31,6 +31,7 @@ def url_with_everything():
3131 '?credentials_path=/some/path/to.json'
3232 '&location=some-location'
3333 '&arraysize=1000'
34+ '&use_bqstorage_api=True'
3435 '&clustering_fields=a,b,c'
3536 '&create_disposition=CREATE_IF_NEEDED'
3637 '&destination=different-project.different-dataset.table'
@@ -46,12 +47,13 @@ def url_with_everything():
4647
4748
4849def test_basic (url_with_everything ):
49- project_id , location , dataset_id , arraysize , credentials_path , job_config = parse_url (url_with_everything )
50+ project_id , location , dataset_id , arraysize , credentials_path , use_bqstorage_api , job_config = parse_url (url_with_everything )
5051
5152 assert project_id == 'some-project'
5253 assert location == 'some-location'
5354 assert dataset_id == 'some-dataset'
5455 assert arraysize == 1000
56+ assert use_bqstorage_api is True
5557 assert credentials_path == '/some/path/to.json'
5658 assert isinstance (job_config , QueryJobConfig )
5759
@@ -69,7 +71,7 @@ def test_basic(url_with_everything):
6971 ('write_disposition' , 'WRITE_APPEND' ),
7072])
7173def test_all_values (url_with_everything , param , value ):
72- job_config = parse_url (url_with_everything )[5 ]
74+ job_config = parse_url (url_with_everything )[6 ]
7375
7476 config_value = getattr (job_config , param )
7577 if callable (value ):
@@ -85,6 +87,7 @@ def test_all_values(url_with_everything, param, value):
8587
8688@pytest .mark .parametrize ("param, value" , [
8789 ('arraysize' , 'not-int' ),
90+ ('use_bqstorage_api' , 'not-bool' ),
8891 ('create_disposition' , 'not-attribute' ),
8992 ('destination' , 'not.fully-qualified' ),
9093 ('dry_run' , 'not-bool' ),
@@ -108,24 +111,26 @@ def test_empty_url():
108111 assert value is None
109112
110113def test_empty_with_non_config ():
111- url = parse_url (make_url ('bigquery:///?location=some-location&arraysize=1000&credentials_path=/some/path/to.json' ))
112- project_id , location , dataset_id , arraysize , credentials_path , job_config = url
114+ url = parse_url (make_url ('bigquery:///?location=some-location&arraysize=1000&use_bqstorage_api=False& credentials_path=/some/path/to.json' ))
115+ project_id , location , dataset_id , arraysize , credentials_path , use_bqstorage_api , job_config = url
113116
114117 assert project_id is None
115118 assert location == 'some-location'
116119 assert dataset_id is None
117120 assert arraysize == 1000
121+ assert use_bqstorage_api is False
118122 assert credentials_path == '/some/path/to.json'
119123 assert job_config is None
120124
121125def test_only_dataset ():
122126 url = parse_url (make_url ('bigquery:///some-dataset' ))
123- project_id , location , dataset_id , arraysize , credentials_path , job_config = url
127+ project_id , location , dataset_id , arraysize , credentials_path , use_bqstorage_api , job_config = url
124128
125129 assert project_id is None
126130 assert location is None
127131 assert dataset_id == 'some-dataset'
128132 assert arraysize is None
133+ assert use_bqstorage_api is None
129134 assert credentials_path is None
130135 assert isinstance (job_config , QueryJobConfig )
131136 # we can't actually test that the dataset is on the job_config,
0 commit comments