From 5a1a2f8a91ec841bb9b9adccffeff6610f8de560 Mon Sep 17 00:00:00 2001 From: Aaron Wolen Date: Thu, 1 Apr 2021 15:50:44 -0500 Subject: [PATCH] Fix error when array type doesn't match selection --- R/TileDBArray.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/TileDBArray.R b/R/TileDBArray.R index f4487107e7..bcdea380b6 100644 --- a/R/TileDBArray.R +++ b/R/TileDBArray.R @@ -119,7 +119,11 @@ tiledb_array <- function(uri, is_sparse_status <- libtiledb_array_schema_sparse(schema_xptr) if (!is.na(is.sparse) && is.sparse != is_sparse_status) { libtiledb_array_close(array_xptr) - stop("sparse array selected but dense array found", call. = FALSE) + if (is_sparse_status) { + stop("dense array selected but sparse array found", call. = FALSE) + } else { + stop("sparse array selected but dense array found", call. = FALSE) + } } is.sparse <- is_sparse_status array_xptr <- libtiledb_array_close(array_xptr)