Skip to content

Missing package name in not installed error #1484

@malcolmbarrett

Description

@malcolmbarrett

Prework

  • I have read and understand help guide.
  • I understand and agree to contributing guide.
  • I am confident this issue is a bug in targets itself, not a user error or a bug in a different package. I have done troubleshooting on my own to verify this. User questions which are not bugs in targets should be posted as discussions instead of bug reports.
  • I am posting a runnable reprex to help others troubleshoot.

Description

Not installed errors emerging from rlang::check_installed() are not being correctly assembled by targets.

reprex

# _targets.R
library(targets)

call_pkg <- function() {
  rlang::check_installed("fake.package")
}

list(
  tar_target(call, call_pkg())
)

I expect:

> tar_make()
+ call dispatched
✖ call errored
✖ errored pipeline [99ms, 0 completed, 0 skipped]
Error:
! The packages "fake.package" are required.

Or better yet The package "fake.package" is required.

Instead, I get an empty string for the package name:

> tar_make()
+ call dispatched
✖ call errored
✖ errored pipeline [99ms, 0 completed, 0 skipped]
Error:
! The packages "" are required.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions