-
-
Notifications
You must be signed in to change notification settings - Fork 171
Expand file tree
/
Copy pathexample.py
More file actions
19 lines (16 loc) · 552 Bytes
/
example.py
File metadata and controls
19 lines (16 loc) · 552 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from typing import List, Iterator, Dict, Any
from google.api_core.client_options import ClientOptions
from google.auth.credentials import AnonymousCredentials
from google.cloud import bigquery, exceptions
def main():
client = bigquery.Client(
"test",
client_options=ClientOptions(api_endpoint="http://bigquery:9050"),
credentials=AnonymousCredentials(),
)
job = client.query(
query="SELECT * FROM dataset1.table_a",
job_config=bigquery.QueryJobConfig(),
)
print(list(job.result()))
main()