Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins committed Oct 18, 2023
1 parent 3ef44c0 commit 6890681
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dataframerow/dataframerow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ index(r::DataFrameRow) = getfield(r, :colindex)
is_column_insertion_allowed(dfr::DataFrameRow) = index(dfr) isa Index

Base.@propagate_inbounds function Base.setindex!(dfr::DataFrameRow, value, idx)
if colinds isa SymbolOrString && columnindex(dfr, colinds) == 0
if idx isa SymbolOrString && columnindex(dfr, idx) == 0
if !is_column_insertion_allowed(dfr)
throw(ArgumentError("creating new columns in a DataFrameRow that subsets " *
"columns of its parent data frame is disallowed"))
Expand All @@ -273,7 +273,7 @@ Base.@propagate_inbounds function Base.setindex!(dfr::DataFrameRow, value, idx)
newcol = similar(val, Union{T,Missing}, nrow(parent(dfr)))
fill!(newcol, missing)
newcol[row(dfr)] = val
parent(dfr)[!, colinds] = newcol
parent(dfr)[!, idx] = newcol
else
setindex!(parent(dfr), value, row(dfr), parentcols(index(dfr), idx))
end
Expand Down

0 comments on commit 6890681

Please sign in to comment.