From e3e60bbdb003a325a4967dd40383a8fc3b4dad38 Mon Sep 17 00:00:00 2001 From: Peter Dudfield <34686298+peterdudfield@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:35:27 +0000 Subject: [PATCH] filter on forecast_uuid too (#100) * filter on forecast_uuid too * fix * format --- database-cleanup/database_cleanup/save.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/database-cleanup/database_cleanup/save.py b/database-cleanup/database_cleanup/save.py index 0c19128..b804746 100644 --- a/database-cleanup/database_cleanup/save.py +++ b/database-cleanup/database_cleanup/save.py @@ -73,7 +73,11 @@ def save_forecast_and_values( fs.mkdir(directory) if site_uuids is not None: - stmt = sa.select(ForecastSQL.forecast_uuid).filter(ForecastSQL.site_uuid.in_(site_uuids)) + stmt = ( + sa.select(ForecastSQL.forecast_uuid) + .filter(ForecastSQL.site_uuid.in_(site_uuids)) + .filter(ForecastSQL.forecast_uuid.in_(forecast_uuids)) + ) forecast_uuids = session.scalars(stmt).all()