From 13088d247aab8b89009f6c377f1535ec722e42a7 Mon Sep 17 00:00:00 2001 From: ehwenk Date: Mon, 18 Nov 2024 16:01:58 +1100 Subject: [PATCH] more fixes --- R/join_.R | 2 +- tests/testthat/test-extract_.R | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/R/join_.R b/R/join_.R index 729a628..bcab06d 100644 --- a/R/join_.R +++ b/R/join_.R @@ -280,7 +280,7 @@ join_contributors <- function(database, compacted_contributors_column <- contributors_tmp %>% - tidyr::nest(-dplyr::all_of("dataset_id")) %>% + tidyr::nest(data = -dplyr::all_of(c("dataset_id"))) %>% dplyr::mutate(data_contributors = purrr::map_chr(data, jsonlite::toJSON)) %>% dplyr::select(-dplyr::any_of("data")) %>% dplyr::ungroup() diff --git a/tests/testthat/test-extract_.R b/tests/testthat/test-extract_.R index 50fd180..1af9465 100644 --- a/tests/testthat/test-extract_.R +++ b/tests/testthat/test-extract_.R @@ -191,7 +191,8 @@ test_that("Extraction of dataset was successful", { }) test_that("Expect error if taxon_name column missing", { - traits_without_taxon_name <- database$traits %>% dplyr::select(-taxon_name) + traits_without_taxon_name <- database + traits_without_taxon_name$traits <- database$traits %>% dplyr::select(-taxon_name) expect_error((traits_without_taxon_name %>% extract_trait("leaf_area"))$traits) })