Skip to content

Commit

Permalink
return unique warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hillalex committed Sep 17, 2024
1 parent c31ecd2 commit 3758726
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ with_warnings <- function(expr, stop_on_error = TRUE) {
my_warnings <- NULL

w_handler <- function(w) {
my_warnings <<- c(my_warnings, jsonlite::unbox(conditionMessage(w)))
my_warnings <<- unique(c(my_warnings, jsonlite::unbox(conditionMessage(w))))
invokeRestart("muffleWarning")
}

e_handler_warn <- function(e) {
my_warnings <<- c(my_warnings, jsonlite::unbox(conditionMessage(e)))
my_warnings <<- unique(c(my_warnings, jsonlite::unbox(conditionMessage(e))))
invokeRestart("muffleStop")
}

Expand Down
6 changes: 3 additions & 3 deletions inst/schema/DataSeries.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"x": {
"type": "array",
"items": {
"type": ["number", "string"]
"type": ["number", "string", "null"]
}
},
"y": {
Expand All @@ -32,7 +32,7 @@
"x": {
"type": "array",
"items": {
"type": ["number", "string"]
"type": ["number", "string", "null"]
}
},
"y": {
Expand All @@ -52,7 +52,7 @@
}
}
},
"required": ["model", "raw", "warnings"],
"required": ["name", "model", "raw", "warnings"],
"additionalProperties": false
}
}

0 comments on commit 3758726

Please sign in to comment.