21
21
"https://www.googleapis.com/auth/bigquery" ,
22
22
"https://www.googleapis.com/auth/cloud-platform" ,
23
23
"https://www.googleapis.com/auth/drive" ,
24
+ "email" ,
24
25
)
25
26
26
27
@@ -30,6 +31,8 @@ def google_client_info():
30
31
31
32
logger = logging .getLogger ()
32
33
34
+ # Create a new google client on query run, database added, dataset added
35
+ # username and email fields are added for impersonation from parse_url (attributes are part of URL object)
33
36
def create_bigquery_client (
34
37
credentials_info = None ,
35
38
credentials_path = None ,
@@ -40,8 +43,6 @@ def create_bigquery_client(
40
43
username = None ,
41
44
email = None ,
42
45
):
43
- logger .critical (
44
- 'yooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo' )
45
46
46
47
default_project = None
47
48
@@ -67,26 +68,19 @@ def create_bigquery_client(
67
68
project_id = default_project
68
69
69
70
if email is not None :
70
- logger .critical ("WE IN BOYS" )
71
- logger .critical (email )
72
- # credentials = credentials.with_scopes(['email'])
73
- # credentials = credentials.with_subject("vedantprajapati@geotab.com")
71
+ logger .debug ("email: {}" .format (email ))
72
+ # credentials = credentials.with_scopes(SCOPES + ("email"))
73
+ credentials = credentials .with_subject ("vedantprajapati@geotab.com" )
74
74
75
75
if username is not None :
76
- logger .critical ("another one" )
77
- logger .critical (username )
78
-
79
-
80
- logger .critical ("client_info" )
81
- logger .critical (google_client_info ())
82
- logger .critical ("projectid" )
83
- logger .critical (project_id )
84
- logger .critical ("credentials" )
85
- logger .critical (credentials )
86
- logger .critical ("location" )
87
- logger .critical (location )
88
- logger .critical ("queryjobconfig" )
89
- logger .critical (default_query_job_config )
76
+ logger .debug ("username: {}" .format (username ))
77
+
78
+
79
+ logger .debug ("client_info: {}" .format (google_client_info ()))
80
+ logger .debug ("projectid: {}" .format (project_id ))
81
+ logger .debug ("credentials info: {}" .format (credentials ))
82
+ logger .debug ("location {}" .format (location ))
83
+ logger .debug ("queryjobconfig {}" .format (default_query_job_config ))
90
84
91
85
return bigquery .Client (
92
86
client_info = google_client_info (),
0 commit comments