Conversation
|
@nalimilan - same here. CI passes cleanly now |
| @inline function Base.filter(f, gdf::GroupedDataFrame; ungroup::Bool=false) | ||
| res = _filter_helper(gdf, f) |
There was a problem hiding this comment.
My idea was to drop other methods and move all the handling to _filter_helper(gdf, f), so that a single common filter method is enough. Or is there anything preventing this?
There was a problem hiding this comment.
We can do this, but what would be the benefit of such a change? (we could also do the same change for filter for AbstractDataFrame). There would no benefit for dispatch as in Base Julia filter already implements 9 methods for filter.
There was a problem hiding this comment.
The downside of doing what you want is that the stack trace when the error occurs would be one level deeper. For example if the user used a wrong call signature and got MethodError it would be method error in _filter_helper not in filter. Example:
julia> f(x) = g(x)
f (generic function with 1 method)
julia> g(x::Int) = 1
g (generic function with 1 method)
julia> g(x::String) = 2
g (generic function with 2 methods)
julia> f(true)
ERROR: MethodError: no method matching g(::Bool)
Closest candidates are:
g(::Int64) at REPL[5]:1
g(::String) at REPL[6]:1
Stacktrace:
[1] f(x::Bool)
@ Main .\REPL[4]:1
[2] top-level scope
@ REPL[7]:1
is hard to understand by regular users, while the following:
julia> h(x::Int) = 1
h (generic function with 1 method)
julia> h(x::String) = 2
h (generic function with 2 methods)
julia> h(true)
ERROR: MethodError: no method matching h(::Bool)
Closest candidates are:
h(::Int64) at REPL[8]:1
h(::String) at REPL[9]:1
Stacktrace:
[1] top-level scope
@ REPL[10]:1
is clearer as in the suggestion they can see the function they tried to call.
There was a problem hiding this comment.
OK. I just thought it would be slightly simpler and would avoid inlining too much code in the caller function. But indeed giving an error immediately matters.
In that case maybe revert the change on this line, as I don't see why only this method would call filter_helper but not others.
|
Do you think it's possible to test that inference works using |
|
Things are strange here. I have checked that and I do not understand the reason. |
|
I also got weird results with the |
|
This is the same unfortunately: |
|
I managed to fix inference issues. Hopefully if they do not hold users will report. |
|
Thank you! |
fixes #2954