Spaces:
Sleeping
Sleeping
UPDATE: exportToDashboard
Browse files
analyticsHub/routers/reportingTool.py
CHANGED
|
@@ -9,6 +9,7 @@ from typing import Annotated
|
|
| 9 |
from . import pipeline
|
| 10 |
import json
|
| 11 |
import os
|
|
|
|
| 12 |
|
| 13 |
router = APIRouter()
|
| 14 |
security = HTTPBearer()
|
|
@@ -23,6 +24,7 @@ async def generateChart(chartDetails: GenerateChartInput, credentials: Annotated
|
|
| 23 |
projectId = chartDetails.projectId,
|
| 24 |
metadata = json.loads(urlopen(fileUrl).read())
|
| 25 |
)
|
|
|
|
| 26 |
return JSONResponse(status_code = 200, content = response)
|
| 27 |
else:
|
| 28 |
return JSONResponse(status_code = 498, content = {"status": "ERROR", "errorDetail": "Invalid Token"})
|
|
@@ -41,6 +43,7 @@ async def generatePanelChart(panelChartDetails: PanelChartDetails, credentials:
|
|
| 41 |
aggregationMetric = panelChartDetails.aggregationMetric,
|
| 42 |
dataSource = panelChartDetails.dataSource
|
| 43 |
)
|
|
|
|
| 44 |
return JSONResponse(status_code = 200, content = response)
|
| 45 |
else:
|
| 46 |
return JSONResponse(status_code = 498, content = {"status": "ERROR", "errorDetail": "Invalid Token"})
|
|
|
|
| 9 |
from . import pipeline
|
| 10 |
import json
|
| 11 |
import os
|
| 12 |
+
import gc
|
| 13 |
|
| 14 |
router = APIRouter()
|
| 15 |
security = HTTPBearer()
|
|
|
|
| 24 |
projectId = chartDetails.projectId,
|
| 25 |
metadata = json.loads(urlopen(fileUrl).read())
|
| 26 |
)
|
| 27 |
+
gc.collect()
|
| 28 |
return JSONResponse(status_code = 200, content = response)
|
| 29 |
else:
|
| 30 |
return JSONResponse(status_code = 498, content = {"status": "ERROR", "errorDetail": "Invalid Token"})
|
|
|
|
| 43 |
aggregationMetric = panelChartDetails.aggregationMetric,
|
| 44 |
dataSource = panelChartDetails.dataSource
|
| 45 |
)
|
| 46 |
+
gc.collect()
|
| 47 |
return JSONResponse(status_code = 200, content = response)
|
| 48 |
else:
|
| 49 |
return JSONResponse(status_code = 498, content = {"status": "ERROR", "errorDetail": "Invalid Token"})
|