Skip to content

Commit 222add4

Browse files
push!(::ParTable, Tuple): check keys compat
Co-authored-by: Maximilian-Stefan-Ernst <[email protected]>
1 parent d8f107a commit 222add4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/frontend/specification/ParameterTable.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ sort_vars(partable::ParameterTable) = sort_vars!(deepcopy(partable))
225225
# add a row --------------------------------------------------------------------------------
226226

227227
function Base.push!(partable::ParameterTable, d::Union{AbstractDict{Symbol}, NamedTuple})
228+
issetequal(keys(partable.columns), keys(d)) ||
229+
throw(ArgumentError("The new row needs to have the same keys as the columns of the parameter table."))
228230
for (key, val) in pairs(d)
229231
push!(partable.columns[key], val)
230232
end

0 commit comments

Comments
 (0)