Skip to content

Commit efbcc7e

Browse files
committed
Apply black formatting to main.py
1 parent b4b4f76 commit efbcc7e

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

code/app/main.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,22 +100,20 @@ def latest():
100100
).fetchone()
101101

102102
if not wallet or not blocks or not metrics:
103-
raise HTTPException(
104-
status_code=404, detail="No metrics available"
105-
)
103+
raise HTTPException(status_code=404, detail="No metrics available")
106104

107105
# Map DB columns to expected API keys
108106
result = {
109107
"f": float(wallet["f"]) if wallet["f"] is not None else None,
110108
"S": float(blocks["S"]) if blocks["S"] is not None else None,
111-
"BXS": float(metrics["BXS_cum"]) if metrics["BXS_cum"] is not None else None,
109+
"BXS": (
110+
float(metrics["BXS_cum"]) if metrics["BXS_cum"] is not None else None
111+
),
112112
}
113113

114114
return result
115115
except sqlite3.OperationalError as e:
116-
raise HTTPException(
117-
status_code=500, detail=f"Database error: {str(e)}"
118-
)
116+
raise HTTPException(status_code=500, detail=f"Database error: {str(e)}")
119117
finally:
120118
conn.close()
121119

@@ -291,7 +289,7 @@ def update_metrics_table(
291289
def root():
292290
"""
293291
Return API information with available endpoints.
294-
292+
295293
Always returns JSON (tests expect "endpoints" key).
296294
"""
297295
return {

0 commit comments

Comments
 (0)