From 9d12eef0e587537932a55fdb7726300380b4c60a Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Thu, 19 Feb 2026 12:22:19 +0000 Subject: [PATCH] Remove unused db functions --- .../db/functions/recommendations_functions.py | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/backend/app/db/functions/recommendations_functions.py b/backend/app/db/functions/recommendations_functions.py index ff9b9dc8..7ffcf603 100644 --- a/backend/app/db/functions/recommendations_functions.py +++ b/backend/app/db/functions/recommendations_functions.py @@ -625,13 +625,6 @@ def get_plans_by_portfolio_id(portfolio_id: int) -> List[PlanModel]: return session_any.exec(stmt).scalars().all() -def get_plans_by_ids(ids: List[int]) -> List[PlanModel]: - stmt = select(PlanModel).where(PlanModel.id.in_(ids)) - with db_read_session() as session: - session_any: Any = session # Typehint as Any to satisfy Pylance... - return session_any.exec(stmt).scalars().all() - - def get_plans_by_scenario_ids(ids: List[int]) -> List[PlanModel]: stmt = select(PlanModel).where(PlanModel.scenario_id.in_(ids)) with db_read_session() as session: @@ -653,24 +646,6 @@ def get_scenarios_by_portfolio_id(portfolio_id: int) -> List[ScenarioModel]: return session_any.exec(stmt).scalars().all() -def get_scenario(scenario_id: int) -> Optional[ScenarioModel]: - stmt = select(ScenarioModel).where(ScenarioModel.id == scenario_id) - with db_read_session() as session: - session_any: Any = session # Typehint as Any to satisfy Pylance... - return session_any.exec(stmt).scalar_one_or_none() - - -def get_default_plan_ids_for_property(property_id: int) -> List[int]: - # This should in reality always return exactly 1 ID, but there's currently - # no database constraint to enforce that, so account for 0 or >1 - stmt = select(PlanModel.id).where( - (PlanModel.property_id == property_id) & (PlanModel.is_default == True) - ) - with db_read_session() as session: - session_any: Any = session # Typehint as Any to satisfy Pylance... - return session_any.exec(stmt).scalars().all() - - def get_default_scenario_ids_for_portfolio(portfolio_id: int) -> List[int]: # This should in reality always return exactly 1 ID, but there's currently # no database constraint to enforce that, so account for 0 or >1