Skip to content

[Bug]: Bigquery exception handling unit tests invoke real credential #22109

@Abacn

Description

@Abacn

What happened?

Running bigquery unit test locally (est_create_temp_dataset_exception, test_query_job_exception, test_read_export_exception, test_copy_load_job_exception, test_load_job_exception) surprisingly pops up google cloud authentication page in web browser.
Taking a close look, the test uses real gcp_client and querying for default project. If the command line environment does not have a gcloud auth configured, it will popup a webpage asking login into google account. Closing this page, the test get stuck and the webpage gets popup again after some time, likely running into a retry logic.

The unit test should neither depend on nor validate real credential.

apache_beam/io/iobase.py:1638: in split
    for source_bundle in source_bundles:
apache_beam/io/gcp/bigquery.py:830: in split
    bq = bigquery_tools.BigQueryWrapper(
apache_beam/io/gcp/bigquery_tools.py:336: in __init__
    self.gcp_bq_client = client or gcp_bigquery.Client(
../../../dev/virtualenv/py38beam/lib/python3.8/site-packages/google/cloud/bigquery/client.py:231: in __init__
    super(Client, self).__init__(
../../../dev/virtualenv/py38beam/lib/python3.8/site-packages/google/cloud/client.py:318: in __init__

Issue Priority

Priority: 2

Issue Component

Component: io-py-gcp

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions