Skip to content

Commit 0bcf9b1

Browse files
author
Jon Wayne Parrott
committed
Move imports into bigquery samples
Change-Id: I0be8d3e0778352a8b814258f83d13d131cb5054e
1 parent 84d5feb commit 0bcf9b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bigquery/cloud-client/user_credentials.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@
2222

2323
import argparse
2424

25-
from google.cloud import bigquery
26-
from google_auth_oauthlib import flow
27-
2825

2926
def run_query(credentials, project, query):
27+
from google.cloud import bigquery
28+
3029
client = bigquery.Client(project=project, credentials=credentials)
3130
query_job = client.query(query)
3231

@@ -36,6 +35,8 @@ def run_query(credentials, project, query):
3635

3736

3837
def authenticate_and_query(project, query, launch_browser=True):
38+
from google_auth_oauthlib import flow
39+
3940
appflow = flow.InstalledAppFlow.from_client_secrets_file(
4041
'client_secrets.json',
4142
scopes=['https://www.googleapis.com/auth/bigquery'])

0 commit comments

Comments
 (0)