Skip to content

Commit 7dae7b7

Browse files
Merge pull request #2 from JZ6/poc_dev
Poc dev
2 parents 8e12019 + 14fa483 commit 7dae7b7

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

sqlalchemy_bigquery/_helpers.py

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"https://www.googleapis.com/auth/bigquery",
2222
"https://www.googleapis.com/auth/cloud-platform",
2323
"https://www.googleapis.com/auth/drive",
24+
"email",
2425
)
2526

2627

@@ -30,6 +31,8 @@ def google_client_info():
3031

3132
logger = logging.getLogger()
3233

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)
3336
def create_bigquery_client(
3437
credentials_info=None,
3538
credentials_path=None,
@@ -40,8 +43,6 @@ def create_bigquery_client(
4043
username=None,
4144
email=None,
4245
):
43-
logger.critical(
44-
'yooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo')
4546

4647
default_project = None
4748

@@ -67,26 +68,19 @@ def create_bigquery_client(
6768
project_id = default_project
6869

6970
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")
7474

7575
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))
9084

9185
return bigquery.Client(
9286
client_info=google_client_info(),

0 commit comments

Comments
 (0)