[add]: refactor/clean up
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user