From 78e052b668d029204daeb17d0ded3938156f1f2b Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Mon, 30 Nov 2026 14:19:20 +0100 Subject: [PATCH] Use `sa.func` instead of importing `func` Naming rule for `velofy`: Import modules instead of objects --- src/velofy/console/forecasts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/velofy/console/forecasts.py b/src/velofy/console/forecasts.py index 3a5ca60..b8cb965 100644 --- a/src/velofy/console/forecasts.py +++ b/src/velofy/console/forecasts.py @@ -9,7 +9,7 @@ import datetime as dt import sys import click -from sqlalchemy import func +import sqlalchemy as sa from sqlalchemy.orm import exc as orm_exc from velofy import config @@ -105,7 +105,7 @@ def tactical_heuristic( # noqa:C901,D417,DOC001 # commands are added the make `Forecast`s without the heuristic! # Continue with forecasting on the day the last prediction was made ... last_predict_at = ( - db.session.query(func.max(db.Forecast.start_at)) + db.session.query(sa.func.max(db.Forecast.start_at)) .join(db.Pixel, db.Forecast.pixel_id == db.Pixel.id) .join(db.Grid, db.Pixel.grid_id == db.Grid.id) .filter(db.Forecast.pixel == pixel)