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

all_args_have_default_values and NULL default parameters #171

Closed
dernst opened this issue Aug 7, 2018 · 1 comment
Closed

all_args_have_default_values and NULL default parameters #171

dernst opened this issue Aug 7, 2018 · 1 comment

Comments

@dernst
Copy link

dernst commented Aug 7, 2018

I have a driver constructor of this form:

foo = function(driverclass=NULL, classpath=NULL) {
#...
new("foo")
}

which gives the following error when trying to run the tests:

> DBItest::test_all(skip=c("package_name", NULL))
Error: Test failed: 'DBItest: Driver: constructor'
* values must be length 1,
 but FUN(X[[1]]) result is length 0
1: expect_warning(expect_that(constructor, all_args_have_default_values()), NA)
2: quasi_capture(enquo(object), capture_warnings, label = label)
3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
4: withCallingHandlers(code, warning = function(condition) {
       out$push(condition)
       invokeRestart("muffleWarning")
   })
5: eval_bare(get_expr(quo), get_env(quo))
6: expect_that(constructor, all_args_have_default_values())
7: condition(object)
8: expect_true(all(vapply(args, as.character, character(1L)) != ""), "has arguments without default values")
9: quasi_label(enquo(object), label)
10: eval_bare(get_expr(quo), get_env(quo))
11: vapply(args, as.character, character(1L))

Are NULL default parameters not allowed for driver constructors in DBI? The error seems to occur in vapply, the analogous statement with lapply seems to give the expected result.
Thanks.

@krlmlr krlmlr closed this as completed in cd3e2e6 Aug 26, 2018
@krlmlr
Copy link
Member

krlmlr commented Aug 26, 2018

Thanks for reporting!

@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants