1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- import pytest
16- import test_utils .prefixer
15+ from typing import Generator
1716
1817from google .cloud import bigquery
18+ import pytest
19+ import test_utils .prefixer
1920
2021prefixer = test_utils .prefixer .Prefixer ("python-bigquery-storage" , "samples/snippets" )
2122
2223
2324@pytest .fixture (scope = "session" , autouse = True )
24- def cleanup_datasets (bigquery_client : bigquery .Client ):
25+ def cleanup_datasets (bigquery_client : bigquery .Client ) -> None :
2526 for dataset in bigquery_client .list_datasets ():
2627 if prefixer .should_cleanup (dataset .dataset_id ):
2728 bigquery_client .delete_dataset (
@@ -30,17 +31,19 @@ def cleanup_datasets(bigquery_client: bigquery.Client):
3031
3132
3233@pytest .fixture (scope = "session" )
33- def bigquery_client ():
34+ def bigquery_client () -> bigquery . Client :
3435 return bigquery .Client ()
3536
3637
3738@pytest .fixture (scope = "session" )
38- def project_id (bigquery_client ) :
39+ def project_id (bigquery_client : bigquery . Client ) -> str :
3940 return bigquery_client .project
4041
4142
4243@pytest .fixture (scope = "session" )
43- def dataset_id (bigquery_client : bigquery .Client , project_id : str ):
44+ def dataset_id (
45+ bigquery_client : bigquery .Client , project_id : str
46+ ) -> Generator [str , None , None ]:
4447 dataset_id = prefixer .create_prefix ()
4548 full_dataset_id = f"{ project_id } .{ dataset_id } "
4649 dataset = bigquery .Dataset (full_dataset_id )
@@ -50,7 +53,9 @@ def dataset_id(bigquery_client: bigquery.Client, project_id: str):
5053
5154
5255@pytest .fixture (scope = "session" )
53- def dataset_id_non_us (bigquery_client : bigquery .Client , project_id : str ):
56+ def dataset_id_non_us (
57+ bigquery_client : bigquery .Client , project_id : str
58+ ) -> Generator [str , None , None ]:
5459 dataset_id = prefixer .create_prefix ()
5560 full_dataset_id = f"{ project_id } .{ dataset_id } "
5661 dataset = bigquery .Dataset (full_dataset_id )
0 commit comments