From c7e880418386092025160abc86d36a857f59706d Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Wed, 22 Oct 2025 12:14:50 -0500 Subject: [PATCH] Resolving pylance error --- backend/app/models/db_models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/app/models/db_models.py b/backend/app/models/db_models.py index 6e3c6c5..3977dd5 100644 --- a/backend/app/models/db_models.py +++ b/backend/app/models/db_models.py @@ -190,7 +190,9 @@ class Play(Base): @property def ai_is_batting(self) -> bool: """Determine if current batting team is AI-controlled""" - if self.half == 'top': + # Type cast for Pylance - at runtime self.half is a string, not a Column + half_value: str = self.half # type: ignore[assignment] + if half_value == 'top': return self.game.away_team_is_ai else: return self.game.home_team_is_ai @@ -198,7 +200,9 @@ class Play(Base): @property def ai_is_fielding(self) -> bool: """Determine if current fielding team is AI-controlled""" - if self.half == 'top': + # Type cast for Pylance - at runtime self.half is a string, not a Column + half_value: str = self.half # type: ignore[assignment] + if half_value == 'top': return self.game.home_team_is_ai else: return self.game.away_team_is_ai