Skip to content

Commit

Permalink
fix: allow insertions that start at 0 (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
Taepper authored May 28, 2024
1 parent d0bcb15 commit f427137
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ void from_json(const nlohmann::json& json, std::unique_ptr<InsertionContains<Sym
"The field 'position' is required in an InsertionContains expression"
)
CHECK_SILO_QUERY(
json["position"].is_number_unsigned() && (json["position"].get<uint32_t>() > 0),
"The field 'position' in an InsertionContains expression needs to be a positive number (> 0)"
json["position"].is_number_unsigned(),
"The field 'position' in an InsertionContains expression needs to be an unsigned integer"
)
CHECK_SILO_QUERY(
!json.contains("sequenceName") || json["sequenceName"].is_string(),
Expand Down
5 changes: 0 additions & 5 deletions src/silo/storage/sequence_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ InsertionEntry parseInsertion(const std::string& value) {
try {
if (position_and_insertion.size() == 2) {
const auto position = boost::lexical_cast<uint32_t>(position_and_insertion[0]);
if (position == 0) {
const std::string message =
"Positions are 1-indexed, position of 0 not allowed in insertion: " + value;
throw silo::preprocessing::PreprocessingException(message);
}
const auto& insertion = position_and_insertion[1];
return {.position_idx = position, .insertion = insertion};
}
Expand Down

0 comments on commit f427137

Please sign in to comment.