Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty strings fail? #60

Closed
muschellij2 opened this issue May 18, 2020 · 4 comments
Closed

Empty strings fail? #60

muschellij2 opened this issue May 18, 2020 · 4 comments

Comments

@muschellij2
Copy link

Empty string gives bad value in a a list. This only started happening with new Bioc version.

library(rhdf5)
filepath = tempfile(fileext = ".h5")
name = "x"
hdr = list(descrip = "")
rhdf5::h5write(hdr, file = filepath, name = name)
#> Error in H5Tset_size(tid, size): HDF5. Invalid arguments to routine. Bad value.

Created on 2020-05-18 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                                      
#>  version  R version 4.0.0 Patched (2020-05-13 r78451)
#>  os       CentOS Linux 7 (Core)                      
#>  system   x86_64, linux-gnu                          
#>  ui       X11                                        
#>  language (EN)                                       
#>  collate  en_US.UTF-8                                
#>  ctype    en_US.UTF-8                                
#>  tz       US/Eastern                                 
#>  date     2020-05-18                                 
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date       lib source                            
#>  assertthat    0.2.1   2019-03-21 [2] CRAN (R 4.0.0)                    
#>  backports     1.1.7   2020-05-13 [2] CRAN (R 4.0.0)                    
#>  callr         3.4.3   2020-03-28 [2] CRAN (R 4.0.0)                    
#>  cli           2.0.2   2020-02-28 [2] CRAN (R 4.0.0)                    
#>  colorout    * 1.2-2   2020-05-18 [1] Github (jalvesaq/colorout@726d681)
#>  crayon        1.3.4   2017-09-16 [2] CRAN (R 4.0.0)                    
#>  desc          1.2.0   2018-05-01 [2] CRAN (R 4.0.0)                    
#>  devtools      2.3.0   2020-04-10 [2] CRAN (R 4.0.0)                    
#>  digest        0.6.25  2020-02-23 [2] CRAN (R 4.0.0)                    
#>  ellipsis      0.3.1   2020-05-15 [2] CRAN (R 4.0.0)                    
#>  evaluate      0.14    2019-05-28 [2] CRAN (R 4.0.0)                    
#>  fansi         0.4.1   2020-01-08 [2] CRAN (R 4.0.0)                    
#>  fs            1.4.1   2020-04-04 [2] CRAN (R 4.0.0)                    
#>  glue          1.4.1   2020-05-13 [2] CRAN (R 4.0.0)                    
#>  highr         0.8     2019-03-20 [2] CRAN (R 4.0.0)                    
#>  htmltools     0.4.0   2019-10-04 [2] CRAN (R 4.0.0)                    
#>  knitr         1.28    2020-02-06 [2] CRAN (R 4.0.0)                    
#>  magrittr      1.5     2014-11-22 [2] CRAN (R 4.0.0)                    
#>  memoise       1.1.0   2017-04-21 [2] CRAN (R 4.0.0)                    
#>  pkgbuild      1.0.8   2020-05-07 [2] CRAN (R 4.0.0)                    
#>  pkgload       1.0.2   2018-10-29 [2] CRAN (R 4.0.0)                    
#>  prettyunits   1.1.1   2020-01-24 [2] CRAN (R 4.0.0)                    
#>  processx      3.4.2   2020-02-09 [2] CRAN (R 4.0.0)                    
#>  ps            1.3.3   2020-05-08 [2] CRAN (R 4.0.0)                    
#>  R6            2.4.1   2019-11-12 [2] CRAN (R 4.0.0)                    
#>  Rcpp          1.0.4.6 2020-04-09 [2] CRAN (R 4.0.0)                    
#>  remotes       2.1.1   2020-02-15 [2] CRAN (R 4.0.0)                    
#>  rhdf5       * 2.33.0  2020-04-27 [2] Bioconductor                      
#>  Rhdf5lib      1.11.0  2020-04-27 [2] Bioconductor                      
#>  rlang         0.4.6   2020-05-02 [2] CRAN (R 4.0.0)                    
#>  rmarkdown     2.1     2020-01-20 [1] CRAN (R 4.0.0)                    
#>  rprojroot     1.3-2   2018-01-03 [2] CRAN (R 4.0.0)                    
#>  sessioninfo   1.1.1   2018-11-05 [2] CRAN (R 4.0.0)                    
#>  stringi       1.4.6   2020-02-17 [2] CRAN (R 4.0.0)                    
#>  stringr       1.4.0   2019-02-10 [2] CRAN (R 4.0.0)                    
#>  testthat      2.3.2   2020-03-02 [2] CRAN (R 4.0.0)                    
#>  usethis       1.6.1   2020-04-29 [2] CRAN (R 4.0.0)                    
#>  withr         2.2.0   2020-04-20 [2] CRAN (R 4.0.0)                    
#>  xfun          0.13    2020-04-13 [2] CRAN (R 4.0.0)                    
#>  yaml          2.2.1   2020-02-01 [2] CRAN (R 4.0.0)                    
#> 
#> [1] /users/jmuschel/R/4.0.x
#> [2] /jhpce/shared/jhpce/core/conda/miniconda3-4.6.14/envs/svnR-4.0.x/R/4.0.x/lib64/R/site-library
#> [3] /jhpce/shared/jhpce/core/conda/miniconda3-4.6.14/envs/svnR-4.0.x/R/4.0.x/lib64/R/library
@grimbough grimbough self-assigned this May 19, 2020
@grimbough
Copy link
Owner

Thanks for the report, I'll look into it.

@grimbough grimbough added this to High priority issues in Bioconductor rhdf5 package suite Jun 3, 2020
@grimbough
Copy link
Owner

Thanks again, this should be patched in version 2.33.4. It didn't only affect writing lists, but any character vector where the contents were all the empty string. I'll also patch the release version on Bioconductor since this is a bug.

library(rhdf5)
filepath = tempfile(fileext = ".h5")
rhdf5::h5write("", file = filepath, name = "X")
h5read(filepath, "X")
#> [1] ""

rhdf5::h5write(list(empty_char = ""), file = filepath, name = "Y")
h5read(filepath, "Y")
#> $empty_char
#> [1] ""

Let me know if you run into more issues.

@muschellij2
Copy link
Author

Was this patched on BioC release? Still seeing the same bug.

@grimbough grimbough reopened this Jun 18, 2020
@grimbough
Copy link
Owner

grimbough commented Jun 18, 2020

Sorry, I should have left the issue open. Thank for reminding me, I wanted to wait a few day to make sure nothing downstream broke in devel before pushing this.

It is now in rhdf5 v 2.32.1, which should propagate in the next day.

Out of interest, what's the usecase for creating vectors with only empty strings?

muschellij2 referenced this issue in muschellij2/NiftiArray Jun 18, 2020
@grimbough grimbough moved this from High priority issues to In progress in Bioconductor rhdf5 package suite Jun 26, 2020
@grimbough grimbough moved this from In progress to Done in Bioconductor rhdf5 package suite May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants