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

Warning in cond$parent: partial match of 'parent' to 'parents' #365

Open
pawelru opened this issue May 17, 2024 · 0 comments
Open

Warning in cond$parent: partial match of 'parent' to 'parents' #365

pawelru opened this issue May 17, 2024 · 0 comments

Comments

@pawelru
Copy link
Contributor

pawelru commented May 17, 2024

Please find below a reprex. I was having a tough times debugging where it is and actually which repo it relates to (here or rlang or processx or something else?). Please feel free to transfer it if needed.
From the tracer debug prints - some objects have both parent and parents (hence only the first one is used when calling x$parent) but there are objects that has only parents (which throw a warning on partial match). I guess we can't just change cond$parent to cond$parents as for the first group a different element will be used.

options(list(
  warnPartialMatchDollar = TRUE,
  warnPartialMatchArgs = TRUE,
  warnPartialMatchAttr = TRUE
))

x <- pkgdepends::new_pkg_deps("r-lib/pkgdepends@thisdoesnotexists")
x$solve()
#> Warning in cond$parent: partial match of 'parent' to 'parents'
#> Warning in cond$parent: partial match of 'parent' to 'parents'
#> Warning in cond$parent: partial match of 'parent' to 'parents'
#> Warning in cond$parent: partial match of 'parent' to 'parents'
#> Warning in cond$parent: partial match of 'parent' to 'parents'
#> Warning in cond$parent: partial match of 'parent' to 'parents'
#> Warning in cond$parent: partial match of 'parent' to 'parents'
#> Warning in cond$parent: partial match of 'parent' to 'parents'

catnl <- function(x) {cat(" "); cat(x); cat("\n")}
trace(conditionMessage, tracer = quote({catnl(class(c)); catnl(names(c)); catnl("")}))
#> Tracing function "conditionMessage" in package "base"
#> [1] "conditionMessage"

x$solve()
#> Tracing conditionMessage(e) on entry 
#>  async_rejected rlib_error_3_0 rlib_error error condition
#>  message call srcref id procsrcref parent aframe calls parents
#>  
#> Tracing conditionMessage(cond) on entry 
#>  async_rejected rlib_error error condition
#>  message call srcref id procsrcref parent aframe calls parents
#>  
#> Tracing conditionMessage(cond$parent) on entry 
#>  async_rejected github_error rlib_error_3_0 rlib_error error condition
#>  message srcref procsrcref aframe calls parents id call
#>  
#> Tracing conditionMessage(cond) on entry 
#>  async_rejected github_error rlib_error error condition
#>  message srcref procsrcref aframe calls parents id call
#> 
#> Warning in cond$parent: partial match of 'parent' to 'parents'

Created on 2024-05-17 with reprex v2.1.0

Why tracing conditionMessage? The longer story is that this fails my strict (i.e. with partial match options) tests and I got the following stack trace:

Warning (...)
partial match of 'parent' to 'parents'
Backtrace:
     ▆
  1. └─(...)
  2.   └─x$solve()
  3.     └─private$plan$solve(policy = private$policy)
  4.       └─pkgdepends:::pkgplan_solve(self, private, match.arg(policy))
  5.         └─pkgdepends:::describe_solution_error(pkgs, res)
  6.           ├─base::conditionMessage(e)
  7.           └─conditionMessage.rlib_error_3_0(e)
  8.             ├─base::paste(cnd_message_(cond, full = FALSE), collapse = "\n")
  9.             └─cnd_message_(cond, full = FALSE)
 10.               └─cnd_message_cli(cond, full)
 11.                 ├─base::conditionMessage(cond$parent)
 12.                 └─conditionMessage.rlib_error_3_0(cond$parent)
 13.                   ├─base::paste(cnd_message_(cond, full = FALSE), collapse = "\n")
 14.                   └─cnd_message_(cond, full = FALSE)
 15.                     └─cnd_message_cli(cond, full)
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

1 participant