Skip to content

data.table: another non-exportable object. #562

@JamesThompsonC

Description

@JamesThompsonC

Thank you Henrik for your generosity in developing and sharing this package.

I discovered another non-exportable object.
Here's the repex:

library(data.table)
library(tibble)
library(foreach)
library(fulure.callr)
library(doFuture)

doFuture::registerDoFuture()
plan(callr, workers = 3)

This gives me what I'm expecting. a three row, two column data.table, each cell a data.table:

o <-
foreach(ii = 1:3) %do% {
data.table(df_a = list(data.table(e = 1:10)),
df_b = list(data.table(d = 1:10)))
}

rbindlist(o)

This returns an error:

o <-
foreach(ii = 1:3) %dopar% {
data.table(df_a = list(data.table(e = 1:10)),
df_b = list(data.table(d = 1:10)))
}

Error: Detected a non-exportable reference (‘externalptr’) in the value (of class ‘list’) of the resolved future

I got %dopar% to work by using tibble's instead of data.tables.

My problem is that most of my functions return data.table's.

o <-
foreach(ii = 1:3) %dopar% {
tibble(df_a = list(tibble(e = 1:10)),
df_b = list(tibble(d = 1:10)))
}

rbindlist(o)

I'm not sure you can do anything about it.
If not, maybe include it in your
"A Future for R: Non-Exportable Objects"
vignette.

~Jim

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions