File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ def create_bq_connection(
106
106
)
107
107
if service_account_id :
108
108
logger .info (
109
- f"Connector { project_id } .{ location } .{ connection_id } already exists"
109
+ f"BQ connection { project_id } .{ location } .{ connection_id } already exists"
110
110
)
111
111
else :
112
112
connection_name , service_account_id = self ._create_bq_connection (
@@ -116,9 +116,14 @@ def create_bq_connection(
116
116
f"Created BQ connection { connection_name } with service account id: { service_account_id } "
117
117
)
118
118
service_account_id = cast (str , service_account_id )
119
+
119
120
# Ensure IAM role on the BQ connection
120
121
# https://cloud.google.com/bigquery/docs/reference/standard-sql/remote-functions#grant_permission_on_function
121
- self ._ensure_iam_binding (project_id , service_account_id , iam_role )
122
+ try :
123
+ self ._ensure_iam_binding (project_id , service_account_id , iam_role )
124
+ except google .api_core .exceptions .PermissionDenied as ex :
125
+ ex .message = f"Failed ensuring IAM binding (role={ iam_role } , service-account={ service_account_id } ). { ex .message } "
126
+ raise
122
127
123
128
# Introduce retries to accommodate transient errors like:
124
129
# (1) Etag mismatch,
You can’t perform that action at this time.
0 commit comments