Closed LostKobrakai closed 1 day ago
@LostKobrakai Thanks for the report!
I think we should accept an empty list of filters. I see no reason not to and it should be a super easy patch.
But first: are the semantics what I think they are? I'm thinking of situations like this where logic dictates certain outcomes for consistency:
Enum.any?([], fn _ -> true end)
#=> false
Enum.all?([], fn _ -> false end)
#=> true
Here, I believe this should be true in all cases:
df1 = DataFrame.new(...)
df2 = DataFrame.filter_with(df1, [])
assert df1 == df2
Is that right?
That's right. A filter expects all conditions to be true and then the row is retained. So it is equivalent to all?
.
Yeah, that would be my understanding. Not providing a filter means no condition to filter by means nothing is filtered away.
@LostKobrakai Should be fixed on main
now. Not sure when it'll be released but hopefully that unblocks you.
Thanks for the quick turnaround.
I worked around it for now appending a condition, which is always true for all records. So I might wait for the next release.
It would be great to have this support an empty list as well (no filtering), but if that's not easily done than at least the typespec for the callback should be adjusted from
to