Arafath10 commited on
Commit
8f5b90d
·
verified ·
1 Parent(s): 1817e05

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -1
main.py CHANGED
@@ -4,6 +4,7 @@ from fastapi.middleware.cors import CORSMiddleware
4
  import requests
5
  import pandas as pd
6
  import json
 
7
 
8
  global data
9
  app = FastAPI()
@@ -122,7 +123,7 @@ async def your_continuous_function(X_Tenant):
122
 
123
  @app.get("/kpi_results")
124
  def read_root(X_Tenant):
125
- data = your_continuous_function(X_Tenant)
126
  status_counts_more_than_80 = data[data['delivery_possibility'] > 80]['status.name'].value_counts()
127
 
128
  status_counts_50_to_80 = data[(data['delivery_possibility'] >= 50) & (data['delivery_possibility'] <= 80)]['status.name'].value_counts()
 
4
  import requests
5
  import pandas as pd
6
  import json
7
+ import aiohttp
8
 
9
  global data
10
  app = FastAPI()
 
123
 
124
  @app.get("/kpi_results")
125
  def read_root(X_Tenant):
126
+ data = await your_continuous_function(X_Tenant)
127
  status_counts_more_than_80 = data[data['delivery_possibility'] > 80]['status.name'].value_counts()
128
 
129
  status_counts_50_to_80 = data[(data['delivery_possibility'] >= 50) & (data['delivery_possibility'] <= 80)]['status.name'].value_counts()