br-g / openf1

OpenF1 API - Real-time and historical Formula 1 data
Other
398 stars 22 forks source link

Kick Sauber team colour doesn't appear correctly #37

Closed applecake1green closed 7 months ago

applecake1green commented 8 months ago

Basically, going to https://api.openf1.org/v1/drivers?session_key=9480 (and all prev. sessions) shows that Kick Sauber's team colour is 5.2e+253. Don't know what's gone on here but it'd be good to check out to see what's gone on!

br-g commented 8 months ago

Thanks for reporting this. I will have a look!

HairyOtter07 commented 7 months ago

@br-g Hi, I encountered this issue so I did some digging around the data, it seems the color being reported is 52e252 in hex, but the ingestor is erroneously treating it as a number in exponential notation when parsing (when I ran float("52e252") to double check, it returns 5.2e+253, which was the observed value).

Maybe in _is_number() and _try_parse_number() just explicitly check if the argument contains an "e" and abort the check/conversion? I'm assuming the F1 data doesn't actually report any numbers large enough to warrant exponential notation, so in theory it shouldn't affect the rest of the data.

br-g commented 7 months ago

Fixed!