Skip to content
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

combine fails for GroupBy when reducing function is bare lambda #18

Open
ExpandingMan opened this issue Jul 14, 2023 · 1 comment
Open

Comments

@ExpandingMan
Copy link
Contributor

I discuss this issue in some more detail in this PR. In summary, combine needs an inner reducing function from the rf argument, but it can't get it if it is supplied directly with a bare anonymous function (i.e. a Reduction is needed). I added some documentation in that PR so that users will know what to do if it gets merged, but a real fix is needed. Doing this without breaking changes will be difficult.

@ExpandingMan
Copy link
Contributor Author

ExpandingMan commented Jul 14, 2023

One possibility which I think would be non-breaking is

struct GroupBy{K, R, IR, T} <: Transducer
    key::K
    rf::R
    inner_rf::IR
    init::T
end

function GroupBy(key, rf, init, inner_rf=rf)
end

but it's a bit wonky and almost definitely not how it would have been done if it were done right in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant