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