diff --git a/DESCRIPTION b/DESCRIPTION index 7ad4c6b7..39016118 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: blockr Title: A block-based framework for data manipulation and visualization -Version: 0.0.2.9031 +Version: 0.0.2.9035 Authors@R: c(person(given = "Nicolas", family = "Bennett", diff --git a/NEWS.md b/NEWS.md index f6f2e77c..be9747c7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# blockr 0.0.2.9031 +# blockr 0.0.2.9035 ## Feature - Improved `submit` feature for blocks. Now submit isn't added as a class but as a special block attribute. When you design a block, you can pass the `submit` parameter like so: diff --git a/R/server.R b/R/server.R index 40d5748a..94d10704 100644 --- a/R/server.R +++ b/R/server.R @@ -236,7 +236,9 @@ generate_server_block <- function( if (is.null(in_dat()) && !inherits(x, "transform_block")) { evaluate_block(blk()) } else { - if (nrow(in_dat()) == 0 && !inherits(x, "parser_block")) return(data.frame()) + if (inherits(in_dat(), "data.frame") && nrow(in_dat()) == 0) { + return(data.frame()) + } evaluate_block(blk(), data = in_dat()) } }) diff --git a/_pkgdown.yml b/_pkgdown.yml index 978229fb..4cd3a6d4 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -206,6 +206,6 @@ reference: news: releases: - - text: "blockr 0.0.2.9031" + - text: "blockr 0.0.2.9035" - text: "blockr 0.0.2" - text: "blockr 0.0.1.9000" diff --git a/tests/testthat/_snaps/block/block-app-001_.new.png b/tests/testthat/_snaps/block/block-app-001_.new.png index 63396905..ce22786d 100644 Binary files a/tests/testthat/_snaps/block/block-app-001_.new.png and b/tests/testthat/_snaps/block/block-app-001_.new.png differ diff --git a/tests/testthat/_snaps/block/block-app-001_.png b/tests/testthat/_snaps/block/block-app-001_.png index 634c6e13..321c6524 100644 Binary files a/tests/testthat/_snaps/block/block-app-001_.png and b/tests/testthat/_snaps/block/block-app-001_.png differ diff --git a/tests/testthat/_snaps/block/block-app-002_.new.png b/tests/testthat/_snaps/block/block-app-002_.new.png deleted file mode 100644 index 88e2cad6..00000000 Binary files a/tests/testthat/_snaps/block/block-app-002_.new.png and /dev/null differ diff --git a/tests/testthat/_snaps/block/block-app-002_.png b/tests/testthat/_snaps/block/block-app-002_.png index 826b2d2b..88e2cad6 100644 Binary files a/tests/testthat/_snaps/block/block-app-002_.png and b/tests/testthat/_snaps/block/block-app-002_.png differ diff --git a/tests/testthat/_snaps/block/block-app-003_.new.png b/tests/testthat/_snaps/block/block-app-003_.new.png deleted file mode 100644 index b4d056ed..00000000 Binary files a/tests/testthat/_snaps/block/block-app-003_.new.png and /dev/null differ diff --git a/tests/testthat/_snaps/block/block-app-003_.png b/tests/testthat/_snaps/block/block-app-003_.png index f598c006..b4d056ed 100644 Binary files a/tests/testthat/_snaps/block/block-app-003_.png and b/tests/testthat/_snaps/block/block-app-003_.png differ diff --git a/tests/testthat/_snaps/block/block-app-004_.new.png b/tests/testthat/_snaps/block/block-app-004_.new.png deleted file mode 100644 index 7cf37837..00000000 Binary files a/tests/testthat/_snaps/block/block-app-004_.new.png and /dev/null differ diff --git a/tests/testthat/_snaps/block/block-app-004_.png b/tests/testthat/_snaps/block/block-app-004_.png index acbb1285..7cf37837 100644 Binary files a/tests/testthat/_snaps/block/block-app-004_.png and b/tests/testthat/_snaps/block/block-app-004_.png differ diff --git a/tests/testthat/_snaps/block/block-app-005_.new.png b/tests/testthat/_snaps/block/block-app-005_.new.png deleted file mode 100644 index f5ae933a..00000000 Binary files a/tests/testthat/_snaps/block/block-app-005_.new.png and /dev/null differ diff --git a/tests/testthat/_snaps/block/block-app-005_.png b/tests/testthat/_snaps/block/block-app-005_.png index a755f04d..30bec99f 100644 Binary files a/tests/testthat/_snaps/block/block-app-005_.png and b/tests/testthat/_snaps/block/block-app-005_.png differ diff --git a/tests/testthat/_snaps/result/result-app-001_.new.png b/tests/testthat/_snaps/result/result-app-001_.new.png index e9b0d0c5..038fed30 100644 Binary files a/tests/testthat/_snaps/result/result-app-001_.new.png and b/tests/testthat/_snaps/result/result-app-001_.new.png differ diff --git a/tests/testthat/_snaps/stack/stack-app-001_.png b/tests/testthat/_snaps/stack/stack-app-001_.png index f5ae933a..30bec99f 100644 Binary files a/tests/testthat/_snaps/stack/stack-app-001_.png and b/tests/testthat/_snaps/stack/stack-app-001_.png differ diff --git a/tests/testthat/_snaps/stack/stack-app-002_.new.png b/tests/testthat/_snaps/stack/stack-app-002_.new.png deleted file mode 100644 index 6b451e7f..00000000 Binary files a/tests/testthat/_snaps/stack/stack-app-002_.new.png and /dev/null differ diff --git a/tests/testthat/_snaps/stack/stack-app-002_.png b/tests/testthat/_snaps/stack/stack-app-002_.png index d28a2e6a..78c2c4ab 100644 Binary files a/tests/testthat/_snaps/stack/stack-app-002_.png and b/tests/testthat/_snaps/stack/stack-app-002_.png differ diff --git a/tests/testthat/_snaps/stack/stack-app-003.json b/tests/testthat/_snaps/stack/stack-app-003.json index 8819cc6c..af565436 100644 --- a/tests/testthat/_snaps/stack/stack-app-003.json +++ b/tests/testthat/_snaps/stack/stack-app-003.json @@ -39,8 +39,8 @@ ], "choices": [ - "function (data) ", - "colnames(data)" + "structure(function (data) ", + "colnames(data), result = c(\"Time\", \"demand\"))" ], "multiple": true } diff --git a/tests/testthat/_snaps/stack/stack-app-003_.new.png b/tests/testthat/_snaps/stack/stack-app-003_.new.png deleted file mode 100644 index b6a99d73..00000000 Binary files a/tests/testthat/_snaps/stack/stack-app-003_.new.png and /dev/null differ diff --git a/tests/testthat/_snaps/stack/stack-app-003_.png b/tests/testthat/_snaps/stack/stack-app-003_.png index 173fce55..25a43b93 100644 Binary files a/tests/testthat/_snaps/stack/stack-app-003_.png and b/tests/testthat/_snaps/stack/stack-app-003_.png differ diff --git a/tests/testthat/_snaps/stack/stack-app-004.json b/tests/testthat/_snaps/stack/stack-app-004.json index 8819cc6c..af565436 100644 --- a/tests/testthat/_snaps/stack/stack-app-004.json +++ b/tests/testthat/_snaps/stack/stack-app-004.json @@ -39,8 +39,8 @@ ], "choices": [ - "function (data) ", - "colnames(data)" + "structure(function (data) ", + "colnames(data), result = c(\"Time\", \"demand\"))" ], "multiple": true } diff --git a/tests/testthat/_snaps/stack/stack-app-004_.new.png b/tests/testthat/_snaps/stack/stack-app-004_.new.png deleted file mode 100644 index 3cd83561..00000000 Binary files a/tests/testthat/_snaps/stack/stack-app-004_.new.png and /dev/null differ diff --git a/tests/testthat/_snaps/stack/stack-app-004_.png b/tests/testthat/_snaps/stack/stack-app-004_.png index df7d30a3..bbc7d98b 100644 Binary files a/tests/testthat/_snaps/stack/stack-app-004_.png and b/tests/testthat/_snaps/stack/stack-app-004_.png differ diff --git a/tests/testthat/_snaps/stack/stack-app-005.json b/tests/testthat/_snaps/stack/stack-app-005.json index 7e62e68f..a70b29a8 100644 --- a/tests/testthat/_snaps/stack/stack-app-005.json +++ b/tests/testthat/_snaps/stack/stack-app-005.json @@ -39,8 +39,8 @@ ], "choices": [ - "function (data) ", - "colnames(data)" + "structure(function (data) ", + "colnames(data), result = c(\"Time\", \"demand\"))" ], "multiple": true } diff --git a/tests/testthat/_snaps/stack/stack-app-005_.new.png b/tests/testthat/_snaps/stack/stack-app-005_.new.png deleted file mode 100644 index e4785146..00000000 Binary files a/tests/testthat/_snaps/stack/stack-app-005_.new.png and /dev/null differ diff --git a/tests/testthat/_snaps/stack/stack-app-005_.png b/tests/testthat/_snaps/stack/stack-app-005_.png index 4f1e88e2..37be1972 100644 Binary files a/tests/testthat/_snaps/stack/stack-app-005_.png and b/tests/testthat/_snaps/stack/stack-app-005_.png differ diff --git a/tests/testthat/_snaps/stack/stack-app-006.json b/tests/testthat/_snaps/stack/stack-app-006.json index 3952aeb2..2cf11793 100644 --- a/tests/testthat/_snaps/stack/stack-app-006.json +++ b/tests/testthat/_snaps/stack/stack-app-006.json @@ -39,8 +39,8 @@ ], "choices": [ - "function (data) ", - "colnames(data)" + "structure(function (data) ", + "colnames(data), result = c(\"Time\", \"demand\"))" ], "multiple": true } diff --git a/tests/testthat/_snaps/stack/stack-app-006_.new.png b/tests/testthat/_snaps/stack/stack-app-006_.new.png deleted file mode 100644 index f4b7011e..00000000 Binary files a/tests/testthat/_snaps/stack/stack-app-006_.new.png and /dev/null differ diff --git a/tests/testthat/_snaps/stack/stack-app-006_.png b/tests/testthat/_snaps/stack/stack-app-006_.png index 0c362ef4..74259bf0 100644 Binary files a/tests/testthat/_snaps/stack/stack-app-006_.png and b/tests/testthat/_snaps/stack/stack-app-006_.png differ diff --git a/tests/testthat/_snaps/stack/stack-app-007.json b/tests/testthat/_snaps/stack/stack-app-007.json index 5d5eae82..2e06ed50 100644 --- a/tests/testthat/_snaps/stack/stack-app-007.json +++ b/tests/testthat/_snaps/stack/stack-app-007.json @@ -39,8 +39,8 @@ ], "choices": [ - "function (data) ", - "colnames(data)" + "structure(function (data) ", + "colnames(data), result = c(\"Time\", \"demand\"))" ], "multiple": true } diff --git a/tests/testthat/_snaps/stack/stack-app-007_.png b/tests/testthat/_snaps/stack/stack-app-007_.png index 9e958ce7..475b2e6e 100644 Binary files a/tests/testthat/_snaps/stack/stack-app-007_.png and b/tests/testthat/_snaps/stack/stack-app-007_.png differ diff --git a/tests/testthat/_snaps/workspace/restore-workspace-app-001_.new.png b/tests/testthat/_snaps/workspace/restore-workspace-app-001_.new.png index 83cfc7a3..e8b4f71f 100644 Binary files a/tests/testthat/_snaps/workspace/restore-workspace-app-001_.new.png and b/tests/testthat/_snaps/workspace/restore-workspace-app-001_.new.png differ diff --git a/tests/testthat/_snaps/workspace/workspace-app-001_.new.png b/tests/testthat/_snaps/workspace/workspace-app-001_.new.png index ba1f0729..30df0c07 100644 Binary files a/tests/testthat/_snaps/workspace/workspace-app-001_.new.png and b/tests/testthat/_snaps/workspace/workspace-app-001_.new.png differ diff --git a/tests/testthat/_snaps/workspace/workspace-app-002_.new.png b/tests/testthat/_snaps/workspace/workspace-app-002_.new.png index 491126e9..df0a8915 100644 Binary files a/tests/testthat/_snaps/workspace/workspace-app-002_.new.png and b/tests/testthat/_snaps/workspace/workspace-app-002_.new.png differ diff --git a/tests/testthat/_snaps/workspace/workspace-app-003_.new.png b/tests/testthat/_snaps/workspace/workspace-app-003_.new.png index 6b69d050..95f66b3c 100644 Binary files a/tests/testthat/_snaps/workspace/workspace-app-003_.new.png and b/tests/testthat/_snaps/workspace/workspace-app-003_.new.png differ diff --git a/tests/testthat/_snaps/workspace/workspace-app-004_.new.png b/tests/testthat/_snaps/workspace/workspace-app-004_.new.png index ba1f0729..30df0c07 100644 Binary files a/tests/testthat/_snaps/workspace/workspace-app-004_.new.png and b/tests/testthat/_snaps/workspace/workspace-app-004_.new.png differ diff --git a/tests/testthat/test-validate-block.R b/tests/testthat/test-validate-block.R index 8513dc8b..1a8ab128 100644 --- a/tests/testthat/test-validate-block.R +++ b/tests/testthat/test-validate-block.R @@ -14,7 +14,6 @@ testServer(module_server_test, { # Invalidate session$setInputs("columns" = "") session$flushReact() - expect_error(out_dat()) expect_false(is_valid$block) expect_identical(is_valid$message, "selected value(s) not among provided choices") expect_identical(is_valid$fields, "columns")