Files
2025-09-09 10:57:47 +01:00

13 lines
385 B
Python

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