-
-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seeing FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas on session load #674
Comments
Can you give me the output of |
|
I reinstalled the master branch in editable mode in a virtual environment and also see the same behavior.
FWIW, I can also reproduce this with Fastf1 v3.4.4 and Pandas v2.2.2 I am trying to downgrade Pandas and isolate when this warning was introduced. It seems like this depracation is relevant but it doesn't say anything about the datetime types specifically |
Did these warnings only start just now? The last Pandas release was in September. The last few FastF1 release most likely didn't change anything relevant. So there is some potential that this in fact caused by a different dependency being updated. Edit: also interesting is the fact that these warnings don't seem to appear in the CI runs. Edit 2: @borolepratik are you installing from master too? If yes, I might have messed up in 976efb3 |
My guess is this is not a bug in general but rather something to do with the specific sessions in question. I have a job that loads session data after every GP and I just searched through the logs. There is no warning of this kind either. I see the same behavior in 3.4.4 so it is not due solely to the commit you are referencing |
I think I have this figured out. The following type coercion does not have the intended effect when the passed argument is another
The following minimal example replicates the condition:
outputs |
We lose any type guarantee on
outputs
This can explain why we have not seen this warning in CI or my race workflow before. It only manifests when a driver does exactly one lap in a practice session. For example, for 2022 GP 10 session 1 the warning is raised for driver numbers 14, 23, 31, 6. And if we
as expected |
See theOehrly#674 for discussion
See #674 for discussion --------- Co-authored-by: theOehrly <23384863+theOehrly@users.noreply.github.com>
@Casper-Guo thank you for figuring this out and @borolepratik thanks for reporting! I just merged #676 to fix this. |
Describe the issue:
Seeing FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas on session load. Happens for atleast these sessions:
Reproduce the code example:
Error message:
The text was updated successfully, but these errors were encountered: