Skanislav commited on
Commit
740e03d
·
1 Parent(s): d7795a9

fix: load_env order

Browse files
Files changed (2) hide show
  1. scripts/markets.py +1 -3
  2. scripts/pull_data.py +5 -2
scripts/markets.py CHANGED
@@ -46,9 +46,6 @@ from queries import (
46
  FPMMS_FIELD,
47
  )
48
 
49
-
50
- load_dotenv()
51
-
52
  ResponseItemType = List[Dict[str, str]]
53
  SubgraphResponseType = Dict[str, ResponseItemType]
54
  BATCH_SIZE = 1000
@@ -463,4 +460,5 @@ def update_fpmmTrades(from_date: str):
463
 
464
  if __name__ == "__main__":
465
  cutoff_date = "2025-01-20"
 
466
  update_fpmmTrades(cutoff_date)
 
46
  FPMMS_FIELD,
47
  )
48
 
 
 
 
49
  ResponseItemType = List[Dict[str, str]]
50
  SubgraphResponseType = Dict[str, ResponseItemType]
51
  BATCH_SIZE = 1000
 
460
 
461
  if __name__ == "__main__":
462
  cutoff_date = "2025-01-20"
463
+ load_dotenv()
464
  update_fpmmTrades(cutoff_date)
scripts/pull_data.py CHANGED
@@ -1,7 +1,11 @@
 
 
 
 
 
1
  import logging
2
  from datetime import datetime
3
  import pandas as pd
4
- from dotenv import load_dotenv
5
  from markets import (
6
  etl as mkt_etl,
7
  DEFAULT_FILENAME as MARKETS_FILENAME,
@@ -32,7 +36,6 @@ from tools_metrics import compute_tools_based_datasets
32
  from get_mech_info import read_all_trades_profitability, clean_old_data_from_json_files
33
 
34
 
35
- load_dotenv()
36
 
37
  logging.basicConfig(
38
  level=logging.INFO,
 
1
+ from dotenv import load_dotenv
2
+
3
+ # if called later there might be problems with the environment variables
4
+ load_dotenv()
5
+
6
  import logging
7
  from datetime import datetime
8
  import pandas as pd
 
9
  from markets import (
10
  etl as mkt_etl,
11
  DEFAULT_FILENAME as MARKETS_FILENAME,
 
36
  from get_mech_info import read_all_trades_profitability, clean_old_data_from_json_files
37
 
38
 
 
39
 
40
  logging.basicConfig(
41
  level=logging.INFO,