From 90c05971936f052130da278cda151c44fb39bd63 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Tue, 1 Dec 2026 11:13:40 +0100 Subject: [PATCH] Type the relationships of `Forecast` Also, move the `db` import to the top --- src/velofy/db/forecasts.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/velofy/db/forecasts.py b/src/velofy/db/forecasts.py index c2b24f0..877f6fa 100644 --- a/src/velofy/db/forecasts.py +++ b/src/velofy/db/forecasts.py @@ -8,6 +8,7 @@ import sqlalchemy as sa from sqlalchemy import orm from sqlalchemy.dialects import postgresql as psql +from velofy import db from velofy.db import meta @@ -174,7 +175,10 @@ class Forecast(meta.Base): ) # Relationships - pixel = orm.relationship("Pixel", back_populates="forecasts") + pixel: orm.Mapped["db.Pixel"] = orm.relationship( + "Pixel", + back_populates="forecasts", + ) def __repr__(self) -> str: """Non-literal text representation.""" @@ -255,6 +259,3 @@ class Forecast(meta.Base): ) return forecasts - - -from velofy import db # noqa:E402 isort:skip