[add]: refactor/clean up

This commit is contained in:
VivianDee
2025-09-09 10:57:47 +01:00
parent d9b6a7e92e
commit 4e22161088
10 changed files with 240 additions and 26 deletions
@@ -0,0 +1,12 @@
from fastapi import HTTPException
from app.salary_analytics.core.state import state
def check_data_loaded():
"""Raise HTTP 400 if no data is loaded into the pipeline."""
if state.pipeline.df is None:
raise HTTPException(
status_code=400,
detail="No data loaded. Please load data first using the /load-data endpoint."
)
return True