Skip to content

Commit

Permalink
consider special case of result block in compat check
Browse files Browse the repository at this point in the history
  • Loading branch information
nbenn committed Nov 7, 2024
1 parent 1333924 commit c0c9987
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ S3method(block_icon,plot_block)
S3method(block_icon,transform_block)
S3method(block_input_check,data_block)
S3method(block_input_check,parser_block)
S3method(block_input_check,result_block)
S3method(block_input_check,transform_block)
S3method(block_output_ptype,dataset_block)
S3method(block_output_ptype,filesbrowser_block)
Expand Down
11 changes: 11 additions & 0 deletions R/block-core.R
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,17 @@ block_input_check.parser_block <- function(x, data, ...) {
input_failure("Expecting string-valued input.")
}

#' @rdname block_io
#' @export
block_input_check.result_block <- function(x, data, ...) {

if (length(get_workspace_stacks()) >= 2L) {
return(invisible(NULL))
}

input_failure("Expecting at least two stacks.")
}

#' @rdname block_io
#' @export
input_failure <- function(..., class = character()) {
Expand Down
3 changes: 3 additions & 0 deletions man/block_io.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c0c9987

Please sign in to comment.