Skip to content

Commit ae7dacd

Browse files
committed
Reject transformations on SubDataFrame with copycols=false
1 parent 5d91c54 commit ae7dacd

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/abstractdataframe/selection.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,12 +1823,26 @@ function manipulate(dfv::SubDataFrame, @nospecialize(args...); copycols::Bool, k
18231823
newinds = Any[]
18241824
seen_single_column = Set{Int}()
18251825
for ind in args
1826+
<<<<<<< HEAD
18261827
if ind isa Pair || ind isa AbstractVecOrMat{<:Pair}
18271828
throw(ArgumentError(
18281829
"Transformations are not supported for SubDataFrame with copycols=false. " *
18291830
"Only column selection is allowed."
18301831
))
18311832
end
1833+
=======
1834+
if ind isa ColumnIndex
1835+
if ind_idx in seen_single_column
1836+
throw(ArgumentError(
1837+
"selecting the same column multiple times " *
1838+
"using Symbol, string or integer is not allowed " *
1839+
"($ind was passed more than once)"
1840+
))
1841+
end
1842+
end
1843+
1844+
1845+
>>>>>>> 8c73674e (Reject transformations on SubDataFrame with copycols=false)
18321846
ind_idx = index(dfv)[ind]
18331847

18341848
if ind isa ColumnIndex

test/utils.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,9 @@ end
196196
@test parent(res.a) === parent(v.a)
197197
@test parent(res.b) === parent(v.b)
198198
end
199+
<<<<<<< HEAD
200+
=======
201+
202+
203+
204+
>>>>>>> 8c73674e (Reject transformations on SubDataFrame with copycols=false)

0 commit comments

Comments
 (0)