Skip to content

Commit

Permalink
Fix expectation bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
NPodlozhniy committed Jan 16, 2023
1 parent 674bd71 commit 0e7a4b1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def get_reality(wks_name, *kwargs) -> list:
credentials=credentials)
return [str(x) for x in df.values[0]]

# Threading to request concurrently
# Threading to request concurrently`
with ThreadPoolExecutor(max_workers=8) as pool:
future_expectation = {}
future_reality = {}
Expand All @@ -75,8 +75,11 @@ def get_reality(wks_name, *kwargs) -> list:
future_reality[wks_name] = pool.submit(get_reality, (wks_name))

# get results from threads
ref_dict = {wks_name: task.result() for wks_name, task in future_expectation.items()}
fact_dict = {wks_name: task.result() for wks_name, task in future_reality.items()}
try:
ref_dict = {wks_name: task.result() for wks_name, task in future_expectation.items()}
fact_dict = {wks_name: task.result() for wks_name, task in future_reality.items()}
except:
pass

text = f"Hello, dear colleague! \n\n Statistics for yesterday by {button}: \n" + \
'\n'.join([f" - {key}" + \
Expand Down

0 comments on commit 0e7a4b1

Please sign in to comment.