-
Notifications
You must be signed in to change notification settings - Fork 117
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
Stack Trace - ValueError: cannot convert float NaN to integer - When a foreign key is null #149
Comments
I can reproduce the error: Exception Type: ValueError |
Fixed it with updating to django-pandas==0.6.6 |
@juliandehne Did updating to 0.6.6 really fix the underlying problem? Re: my issue #128 I was also getting the same stack trace as you pasted above ("ValueError: cannot convert float NaN to integer"). I apparently wasn't getting that back at the end of 2020, so I presume something changed in Django, and now that I am using 3.2.7, I see the same traceback as you pasted. So: I do think this issue is the same as #128. But: What I see when I upgrade to 0.6.6 is that now, the exception is not getting triggered, but the underlying problem I described in #128 is still there: "if one null is present, all rows in the df become Null." (see my issue for an illustration). It would be great if you could carefully check your situation to confirm or not confirm this observation -- thank you. cc: @chrisdev |
In this example sport.expendables is a queryset that has Django objects with regular fields and ForeignKey fields.
The foreignKey fields are nullable
user = models.ForeignKey(UserProfile,on_delete=models.SET_NULL,blank=True,null=True)
If a user gets deleted from the database, the user foreign key on this model would get set to null.
However when try to run the read_frame on the query set, it causes this Stack Trace.
This seems to have a similar root cause to #128 however it is causing a different issue, stack trace instead of all None, or convert to float.
The text was updated successfully, but these errors were encountered: