Skip to content

Commit a1d42c8

Browse files
committed
Move google API keys and queries inside data collection directory
1 parent 742ceff commit a1d42c8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

data_collection_scripts/big_query_balance_data.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""
2-
This script can be used to run queries on BigQuery for any number of blockchains, and save the results in the input
3-
directory of the project.
4-
The relevant queries must be stored in a file named 'queries.yaml' in the root directory of the project.
2+
This script can be used to run queries on BigQuery for any number of blockchains,
3+
and save the results in the input directory of the project.
4+
The relevant queries must be stored in a file named 'queries.yaml'
5+
in the data_collection_scripts directory of the project.
56
67
Attention! Before running this script, you need to generate service account credentials from Google, as described
78
here (https://developers.google.com/workspace/guides/create-credentials#service-account) and save your key in the
@@ -22,7 +23,7 @@ def collect_data(ledgers, snapshot_dates, force_query):
2223
if not input_dir.is_dir():
2324
input_dir.mkdir()
2425

25-
with open(root_dir / "queries.yaml") as f:
26+
with open(root_dir / "data_collection_scripts/queries.yaml") as f:
2627
queries = safe_load(f)
2728

2829
i = 0
@@ -44,7 +45,7 @@ def collect_data(ledgers, snapshot_dates, force_query):
4445

4546
while True:
4647
try:
47-
client = bq.Client.from_service_account_json(json_credentials_path=root_dir / f"google-service-account-key-{i}.json")
48+
client = bq.Client.from_service_account_json(json_credentials_path=root_dir / f"data_collection_scripts/google-service-account-key-{i}.json")
4849
except FileNotFoundError:
4950
logging.info(f'Exhausted all {i} service account keys. Aborting..')
5051
all_quota_exceeded = True

google-service-account-key-SAMPLE.json renamed to data_collection_scripts/google-service-account-key-SAMPLE.json

File renamed without changes.

0 commit comments

Comments
 (0)