explorer
explorer copied to clipboard
Split filter/2 in two functions
@cigrainger I was wondering if we should break filter/2
in two functions: mask(dataframe, series)
and filter(dataframe, callback)
.
The rationale for doing so is that we don't want to encourage filter(dataframe, series)
, as that won't be efficient as a lazy query. So I thought we should make filter/2
to be exclusively function based (and across
based in the future based on #223) and provide a specific mask/2
function for masking.
Thoughts?
Sorry I meant to say ages ago that I agree with this. Mask is perfect.
@cigrainger so last time we talked we were not sure if we should allow the mask in filter_with
(instead of filter
) or introduce the mask
function. Between those options, any preference?
The mask in filter_with
doesn't have the ambiguity this issue first comments on... so it may be theoretically fine, although some adapters like SQL cannot implement the mask version anyway.
I think a separate mask function makes more sense to me. It seems cleaner. But I don't hold a strong opinion on this one. How much do we think folks should use filter_with directly?
Once we land the macro version of filter/2
, there is little to no reason to use filter_with/2
? So yeah, it makes sense to have mask/2
then!
Agreed! Let's do it.