Skip to content

Commit 4daaa3a

Browse files
committed
fix: cleaned up code
1 parent 1416418 commit 4daaa3a

File tree

2 files changed

+6
-27
lines changed

2 files changed

+6
-27
lines changed

main.py

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
from fastapi import FastAPI, HTTPException, Security, Depends
2-
from fastapi.security import APIKeyQuery, APIKeyHeader
3-
from starlette.status import HTTP_403_FORBIDDEN
4-
import pandas as pd
5-
6-
import pinkbombs as pb
1+
from fastapi import FastAPI, Depends
72
from pinkbombs import api, verify_token
83

94
GRAPHS = ["aqua-tonnes"]
@@ -15,23 +10,4 @@
1510
api.router,
1611
prefix="/api/v1/secure",
1712
dependencies=[Depends(verify_token)]
18-
)
19-
20-
# @app.get("/")
21-
# async def root():
22-
# return {"message": "Hello World"}
23-
24-
25-
# @app.get("/graphs/{graph_name}")
26-
# async def read_item(graph_name):
27-
# if graph_name not in GRAPHS:
28-
# raise HTTPException(status_code=404, detail="Item not found")
29-
# df = pd.read_excel(
30-
# "data/atlantic_salmon-aquaculture_tonnes_live_weight_by_country_by_year.xlsx",
31-
# )
32-
# chart_obj=pb.make_area_chart(
33-
# df,
34-
# "ISO2 Code",
35-
# "Tonnes - live weight"
36-
# )
37-
# return {"graph_name": graph_name, "graph": chart_obj.to_json(), "path": "data/atlantic_salmon-aquaculture_tonnes_live_weight_by_country_by_year.xlsx"}
13+
)

pinkbombs/router/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ async def generate(graph_name, connection: bool = Depends(verify_token)):
2424
"ISO2 Code",
2525
"Tonnes - live weight"
2626
)
27-
return {"graph_name": graph_name, "graph": chart_obj.to_json(), "path": "data/atlantic_salmon-aquaculture_tonnes_live_weight_by_country_by_year.xlsx"}
27+
return {
28+
"graph_name": graph_name, "graph": chart_obj.to_json(),
29+
"path": "data/atlantic_salmon-aquaculture_tonnes_live_weight_by_country_by_year.xlsx",
30+
}

0 commit comments

Comments
 (0)