Add broadcasting of selectors to the minilanguage#2918
Conversation
|
Additionally I have caught two bugs in the existing implementation: (both are fixed) |
| for cei in cs | ||
| @assert cei isa Union{Pair, Base.Callable, ColumnIndex, MultiColumnIndex, | ||
| AbstractVecOrMat{<:Pair}} | ||
| if !(cei isa AbstractMatrix && isempty(cei)) |
There was a problem hiding this comment.
I guess this is again because of broadcasting returning Matrix{Any}? It's somewhat ugly to have to handle this special case here. Would there be any way to fix this elsewhere?
There was a problem hiding this comment.
Yes - this is the Matrix{Any} case special handling. This is essentially the only place we can handle this in a short way. The point is that we want to do AbstractVecOrMat{<:Pair} check below (not to allow arbitrary matrices to leak further unless they are empty as then it does not matter what eltype they have - and thus the additional check).
Co-authored-by: Milan Bouchet-Valat <nalimilan@club.fr>
|
CI failure here is unrelated. |
src/abstractdataframe/selection.jl
Outdated
| is not a valid transformation specification. | ||
|
|
||
| Note! If `cols` or `target_cols` is one of `All`, `Cols`, `Between`, or | ||
| `Not` and is used in a broadcasting context are properly expanded to |
There was a problem hiding this comment.
There's a syntax problem here. Just copy the text from above?
There was a problem hiding this comment.
I have forgotten to sync the docstrings. Fixed.
|
Thank you! |
@nalimilan + @pdeffebach: I am sharing the preview of the functionality making e.g.
Not(:x1) .=> sumwork in the minilanguage.The core mechanism should be working for intended cases.
What is todo:
select,subsetetc. functions that should call it