-
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
make SubIndex strict about duplicates #2022
Conversation
I have said that the performance hit is large for selection of kind Current implementation
Proposed in this PR:
And what I say is that these nanosecond differences will be negligible anyway as if you try doing anything later with such
|
Co-Authored-By: Milan Bouchet-Valat <nalimilan@club.fr>
That's fine. But why not keep these |
We can discuss it. It is a matter of taste. I prefer as little magic as possible in the source code, so the average DataFrames.jl user can understand what is going on (the codebase for indexing and views is already quite complex I think). If we revert But - if you prefer I will revert |
So in short having or not having |
OK, fine with me. |
test/cat.jl
Outdated
@test vcat(view(df, 1:2, [1,2,3,1,2,3]), view(df, 3:5, [3,2,1,1,2,3])) == df | ||
@test all(==(df[1, :]), eachrow(vcat(view(df, [1,1,1], [1,2,3,1,2,3]), | ||
view(df, [1,1,1], [3,2,1,1,2,3])))) | ||
@test_throws ArgumentError vcat(view(df, 1:2, [1,2,3,1,2,3]), |
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.
vcat
isn't needed anymore, right? Same below for all
.
Co-Authored-By: Milan Bouchet-Valat <nalimilan@club.fr>
Re: I have added another tests for duplicate columns when trying to make a |
@nalimilan - thank you! |
see the discussion in #1958.
Rationale for this change:
DataFrameRow
orSubDataFrame
will be affected is only when indexing byAbstractVector{Int}
is performed (abut not ranges - as they will be fast) - so I guess the case when it is needed is pretty rareSubIndex
default constructor with appropriate valueslazyremap!
have a bit less work to do later