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

Blocker: import_future() won't find re-exports from 'parallelly' #173

Closed
HenrikBengtsson opened this issue Oct 20, 2020 · 2 comments · Fixed by #174
Closed

Blocker: import_future() won't find re-exports from 'parallelly' #173

HenrikBengtsson opened this issue Oct 20, 2020 · 2 comments · Fixed by #174

Comments

@HenrikBengtsson
Copy link
Contributor

I'm moving lots of functions to the new parallelly package, cf. futureverse/future#432. I'm still re-exporting these functions in future. However, running revdep checks on furrr 0.2.0 gives the following errors:

* checking Rd contents ... OK
  Backtrace:
   1. furrr:::furrr_test_that(...)
   2. furrr:::supported_strategies() checks/furrr/new/furrr.Rcheck/tests/testthat/helper-furrr-test-that.R:8:2
   3. furrr:::import_future("supportsMulticore") checks/furrr/new/furrr.Rcheck/tests/testthat/helper-furrr-test-that.R:27:2
   4. furrr:::import_from(name, default = default, package = "future")
  
  ── 7. Error: (unknown) (@test-future-modify.R#4)  ──────────────────────────────
  No such 'future' function: supportsMulticore()
  Backtrace:
   1. furrr:::furrr_test_that(...)
   2. furrr:::supported_strategies() checks/furrr/new/furrr.Rcheck/tests/testthat/helper-furrr-test-that.R:8:2
   3. furrr:::import_future("supportsMulticore") checks/furrr/new/furrr.Rcheck/tests/testthat/helper-furrr-test-that.R:27:2
   4. furrr:::import_from(name, default = default, package = "future")
  
  ── 8. Error: (unknown) (@test-future-pmap.R#4)  ────────────────────────────────
  No such 'future' function: supportsMulticore()
  Backtrace:
   1. furrr:::furrr_test_that(...)
   2. furrr:::supported_strategies() checks/furrr/new/furrr.Rcheck/tests/testthat/helper-furrr-test-that.R:8:2
   3. furrr:::import_future("supportsMulticore") checks/furrr/new/furrr.Rcheck/tests/testthat/helper-furrr-test-that.R:27:2
   4. furrr:::import_from(name, default = default, package = "future")
  
  ── 9. Error: (unknown) (@test-future-walk.R#1)  ────────────────────────────────
  No such 'future' function: supportsMulticore()
  Backtrace:
   1. furrr:::furrr_test_that(...)
   2. furrr:::supported_strategies() checks/furrr/new/furrr.Rcheck/tests/testthat/helper-furrr-test-that.R:8:2
   3. furrr:::import_future("supportsMulticore") checks/furrr/new/furrr.Rcheck/tests/testthat/helper-furrr-test-that.R:27:2
   4. furrr:::import_from(name, default = default, package = "future")
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 44 | SKIPPED: 1 | WARNINGS: 0 | FAILED: 9 ]

These errors will prevent me from going ahead with the new, trimmed future release. The fix is to update import_from(), which I guess you've got from future.apply, to use the less conservative inherits = TRUE;

furrr:::import_from
function (name, default = NULL, package) 
{
    ns <- getNamespace(package)
    if (exists(name, mode = "function", envir = ns, inherits = TRUE)) {
        get(name, mode = "function", envir = ns, inherits = TRUE)
    }
    else if (!is.null(default)) {
        default
    }
    else {
        stop(sprintf("No such '%s' function: %s()", package, 
            name))
    }
}

OTH, why not just do a regular import or use future::supportsMulticore() here?

@DavisVaughan
Copy link
Collaborator

@HenrikBengtsson furrr 0.2.1 is on CRAN with the fix!

@HenrikBengtsson
Copy link
Contributor Author

Awesome. A quick check gives that it now works with the feature/parallelly branch of future. Thanks for the quick turnaround.

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

Successfully merging a pull request may close this issue.

2 participants