update(import_data.jl): add error message on single_result_table format

- missing motherboard id
This commit is contained in:
Wataru Otsubo 2024-11-12 18:18:00 +09:00
parent 1868270dab
commit ea4d8c7d6d

View file

@ -141,7 +141,15 @@ function add_psboard_ids(db::SQLite.DB, single_result_table::DataFrame)
dropmissing!(df, :daughterboard)
return (daughterboard = df.daughterboard |> last,)
end
filter!(:motherboard_id => !=(999999), df)
try
filter!(:motherboard_id => !=(999999), df)
catch
id_missings = findall(ismissing, df.motherboard_id)
if !isempty(id_missings)
@error "motherboard id at row $(id_missings) are missing. motherboard id cannot be null"
error("single_result_table format error")
end
end
stmt_insert_psbid = DBInterface.prepare(
db,