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

BiocGenerics package interferes with some mlr3 printers #1112

Closed
mb706 opened this issue Aug 23, 2024 · 2 comments
Closed

BiocGenerics package interferes with some mlr3 printers #1112

mb706 opened this issue Aug 23, 2024 · 2 comments

Comments

@mb706
Copy link
Collaborator

mb706 commented Aug 23, 2024

library("mlr3")
BiocGenerics::which(FALSE)
#> integer(0)
resample(tsk("iris"), lrn("classif.rpart"), rsmp("holdout"))
#> INFO  [16:12:14.448] [mlr3] Applying learner 'classif.rpart' on task 'iris' (iter 1/1)
#> <ResampleResult> with 1 resampling iterations
#> Error in as.vector(x, "character") : 
#>   cannot coerce type 'environment' to vector of type 'character'

The BiocGenerics package gets loaded indirectly when using Bioconductor packages, e.g. NMF:

library("mlr3")
library("NMF")
#> Loading required package: registry
#> Loading required package: rngtools
#> Loading required package: cluster
#> NMF - BioConductor layer [OK] | Shared memory capabilities [OK] | Cores 2/2
resample(tsk("iris"), lrn("classif.rpart"), rsmp("holdout"))
#> INFO  [16:15:25.294] [mlr3] Applying learner 'classif.rpart' on task 'iris' (iter 1/1)
#> <ResampleResult> with 1 resampling iterations
#> Error in as.vector(x, "character") : 
#>   cannot coerce type 'environment' to vector of type 'character'

The problem is that BiocGenerics registers a format.list() function, which then triggers the data.table printer to call format.list() on our R6-valued list columns.

@mb706
Copy link
Collaborator Author

mb706 commented Aug 23, 2024

Also reported here: Rdatatable/data.table#6392

mb706 added a commit to mlr-org/mlr3pipelines that referenced this issue Aug 23, 2024
@berndbischl
Copy link
Sponsor Member

I don't really think we can do much on our side. This must be fixed in datatable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants