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

Make ByRow subtype Function #2212

Merged
merged 5 commits into from
Apr 28, 2020
Merged

Make ByRow subtype Function #2212

merged 5 commits into from
Apr 28, 2020

Conversation

oxinabox
Copy link
Contributor

ByRow is a function wrapper.
Its callable, so it works like a function.
As such it is not unreasonable to for it to subtype Function
Which means it is also covered by Base.Callable.
Which means we can simplify some of the more complex type constraints.
(I noticed this because these get more complex in #2199 )

In general I think if something is callable and doesn't already have a supertype, it is a fairly good idea to make it subtype Function.

(i would be in general a fan of dropping the constraints here entirely, but that would require closer looking at the code to see if it would cause any change in dispatch)

@bkamins
Copy link
Member

bkamins commented Apr 27, 2020

Thank you. Makes sense. Is it rebased against master (I have just merged #2199). If not can you please rebase?

@bkamins
Copy link
Member

bkamins commented Apr 27, 2020

If we go for it also remove line Base.broadcastable(x::ByRow) = Ref(x) as Function is broadcastable in Base already.

@oxinabox
Copy link
Contributor Author

done

Copy link
Member

@bkamins bkamins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you. @nalimilan - can you also have a quick look at this please?

@oxinabox - there is also one more Union to clean-up here: https://github.com/JuliaData/DataFrames.jl/blob/master/src/groupeddataframe/splitapplycombine.jl#L1096

@bkamins bkamins added the non-breaking The proposed change is not breaking label Apr 27, 2020
@bkamins bkamins added this to the 1.0 milestone Apr 27, 2020
Copy link
Member

@nalimilan nalimilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bkamins bkamins merged commit 05a9c43 into JuliaData:master Apr 28, 2020
@bkamins
Copy link
Member

bkamins commented Apr 28, 2020

Merged. Thank you!

@oxinabox oxinabox deleted the patch-5 branch April 29, 2020 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-breaking The proposed change is not breaking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants