From e6e9fc550b70de4375800352f0ce639eccfe75c3 Mon Sep 17 00:00:00 2001 From: LTLA Date: Thu, 30 Nov 2023 16:46:14 -0800 Subject: [PATCH] No need to defend against truncated string attributes from rhdf5. --- DESCRIPTION | 6 +++--- R/saveArray.R | 9 +-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0250af2..9e111a0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: alabaster.matrix Title: Load and Save Artifacts from File -Version: 1.3.1 -Date: 2023-11-28 +Version: 1.3.2 +Date: 2023-11-30 Authors@R: person("Aaron", "Lun", role=c("aut", "cre"), email="infinite.monkeys.with.keyboards@gmail.com") License: MIT + file LICENSE Description: @@ -18,7 +18,7 @@ Imports: DelayedArray (>= 0.27.2), S4Arrays, SparseArray, - rhdf5, + rhdf5 (>= 2.47.1), HDF5Array, Matrix, Rcpp diff --git a/R/saveArray.R b/R/saveArray.R index c9acaab..45e57a6 100644 --- a/R/saveArray.R +++ b/R/saveArray.R @@ -61,14 +61,7 @@ NULL if (!is.null(optimized$placeholder)) { dhandle <- H5Dopen(ghandle, "data") on.exit(H5Dclose(dhandle), add=TRUE, after=FALSE) - - # Patch until rhdf5::H5Awrite is fixed. - atype <- optimized$type - if (type(x) == "character") { - atype <- NULL - } - - h5_write_attribute(dhandle, missingPlaceholderName, optimized$placeholder, type=atype, scalar=TRUE) + h5_write_attribute(dhandle, missingPlaceholderName, optimized$placeholder, type=optimized$type, scalar=TRUE) } save_names(ghandle, x, transpose=TRUE)