File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
src/dbt/adapters/bigquery Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1+ kind : Under the Hood
2+ body : Validate notebooks authorization request has succeeded
3+ time : 2025-09-02T10:10:29.143638-07:00
4+ custom :
5+ Author : colin-rogers-dbt
6+ Issue : " 1307"
Original file line number Diff line number Diff line change @@ -332,7 +332,16 @@ def _config_notebook_job(
332332 url = "https://www.googleapis.com/oauth2/v2/userinfo" ,
333333 headers = {"Authorization" : f"Bearer { self ._GoogleCredentials .token } " },
334334 )
335- notebook_execution_job .execution_user = json .loads (response .data ).get ("email" )
335+ if response .status != 200 :
336+ raise DbtRuntimeError (
337+ f"Failed to retrieve user info. Status: { response .status } , Body: { response .data } "
338+ )
339+ if user_email := json .loads (response .data ).get ("email" ):
340+ notebook_execution_job .execution_user = user_email
341+ else :
342+ raise DbtRuntimeError (
343+ "Authorization request to get user failed to return an email."
344+ )
336345 else :
337346 raise ValueError (
338347 f"Unsupported credential method in BigFrames: '{ self ._connection_method } '"
You can’t perform that action at this time.
0 commit comments