GoogleCloudPlatform / GoogleCloudPlatform/professional-services-data-validator
Impersonation credentials issue - Airflow
- Dominant language
- Python
- Stars
- 524
- Forks
- 171
- Avg merge
- 5d 15h
- Merged PRs (30d)
- 4
Description
Hi Team,
I am trying to use this tool to validate some tables in BigQuery. I have am using the code example mentioned here https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/samples/airflow/dvt_airflow_dag.py
I am getting the below mentioned error:
```py
google.api_core.exceptions.Forbidden: 403 GET .... Access Denied: Table project_id:dataset_id.table_name : Permission bigquery.tables.get denied on table project_id:dataset_id.table_name (or it may not exist.)
```
I am using the correct impersonated credentials. e.g.
```py
project_id = projectId
target_scopes = [
"https://www.googleapis.com/auth/cloud-platform"
]
default_creds, _ = google.auth.default()
impersonated_creds = impersonated_credentials.Credentials(
source_credentials=default_creds,
target_principal=SERVICE_ACCOUNT,
target_scopes=target_scopes,
)
handler = bqhandler.BigQueryResultHandler.get_handler_for_project(project_id = project_id, credentials=impersonated_creds)
```
Please help me figure out what am I doing wrong?
Contributor guide
Assessment
This issue has not been assessed yet.