Resolving pylance error

This commit is contained in:
Cal Corum 2025-10-22 12:14:50 -05:00
parent a287784328
commit c7e8804183

View File

@ -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