Open Casper-Guo opened 2 days ago
Values in LEGACY_TEAM_TRANSLATE
are used as keys for LEGACY_TEAM_COLORS
without checking:
return LEGACY_TEAM_COLORS[LEGACY_TEAM_TRANSLATE[identifier.upper()]]
There is no rb
key in LEGACY_TEAM_COLORS
:
LEGACY_TEAM_COLORS = {
'mercedes': '#00d2be', 'ferrari': '#dc0000',
'red bull': '#fcd700', 'mclaren': '#ff8700',
'alpine': '#fe86bc', 'aston martin': '#006f62',
'sauber': '#00e701', 'visa rb': '#1634cb',
'haas': '#ffffff', 'williams': '#00a0dd'
}
LEGACY_TEAM_TRANSLATE: dict[str, str] = {
'MER': 'mercedes',
'FER': 'ferrari',
'RBR': 'red bull',
'MCL': 'mclaren',
'APN': 'alpine',
'AMR': 'aston martin',
'SAU': 'sauber',
'RB': 'rb',
'HAA': 'haas',
'WIL': 'williams'
}
Confirmed locally that this is the only change needed
Describe the issue:
The legacy
team_color
function throws aKeyError
whenrb
is used as an inputReproduce the code example:
Error message: