-
Notifications
You must be signed in to change notification settings - Fork 360
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
improve naming of anonymous functions in aggregate #1576
Conversation
Thanks. I guess detecting anonymous functions that way is fine. I'm not sure using |
src/groupeddataframe/grouping.jl
Outdated
@@ -376,11 +376,16 @@ function aggregate(d::AbstractDataFrame, | |||
aggregate(groupby(d, cols, sort=sort), fs) | |||
end | |||
|
|||
function dfnameof(f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why df
? Sounds like "data frame".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the reason because I want to get a name of f
for internal DataFrames.jl purposes. Do you have any suggestion what would be a good name.
I also can change it to an anonymous function call in line 385 if this is preferred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe funname
or something like that? Just bikeshedding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
I use
If we want ASCII, then maybe |
I'm not a fan of A few ideas: |
|
FWIW, I like lambda. |
I merge |
October is about to end, so I proposed to solve #1276.
I use standard
DataFrame
constructor machinery to generate names. The default suffix for lambda function isλ
.Also added
makeunique
keyword argument as it was missing (as here I guess we should set it totrue
it by default).I do not know a better approach to test if a function is anonymous than by checking if first character of its name is
#
(maybe there is a cleaner solution to this?).