You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Null is basically unsupported. It is hard to filter nulls and much harder to grasp when exactly null is being substituted by default(T).
To Reproduce
Nuget Micorsoft.Data.Analysis 0.20.1:
Thanks for addressing this! I was just trying it out to see what workloads are in range with the mda dataframe. I have to confess I was slightly disappointed, although performace was good.
AFAICT in SQL most functions yield NULL when there is no non-null input, and treat NULL input as if nothing happened. Maybe that clarifies the cumulative case? In any case I would align to SQL where sensible.
But as you say, to keep embarassing stuff from popping up the whole API (not just math) needs to be reviewed and probably deserves null/0 test cases. For example, sum may return both null or 0, they are truly different cases.
Activity
JakeRadMSFT commentedon May 6, 2023
The bad news is that's embarrassing :)
The good news is that it's actually all generated from a TT file - so it should be fairly easy to update all of them.
https://github.com/dotnet/machinelearning/blob/main/src/Microsoft.Data.Analysis/PrimitiveDataFrameColumnComputations.tt
Would you be up for giving it a shot? @simonthum
I'm happy to review the PR. I'm planning to investigate a bunch of DataFrame bugs but I'm not sure when I'll get to this one.
Related Issue: #6144
JakeRadMSFT commentedon May 6, 2023
I'd probably try to get it to generate something like this:
The IsValid call checks if it's null and excludes it from the sum.
JakeRadMSFT commentedon May 6, 2023
I think I made the needed changes in #6661 but it would need a bunch of tests added.
I specifically don't know what the cumulative functions should do with nulls.
If the old value in that spot was null should the new value be null. In my code it isn't because the cumulative to that point is never null.
simonthum commentedon May 8, 2023
Thanks for addressing this! I was just trying it out to see what workloads are in range with the mda dataframe. I have to confess I was slightly disappointed, although performace was good.
AFAICT in SQL most functions yield NULL when there is no non-null input, and treat NULL input as if nothing happened. Maybe that clarifies the cumulative case? In any case I would align to SQL where sensible.
But as you say, to keep embarassing stuff from popping up the whole API (not just math) needs to be reviewed and probably deserves null/0 test cases. For example, sum may return both null or 0, they are truly different cases.
luisquintanilla commentedon May 10, 2023
Closing this issue since the PR to address this issue has already been merged. Thanks @simonthum