-
Notifications
You must be signed in to change notification settings - Fork 3
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
Have check_package()
return error or TRUE (on valid)
#245
Comments
Do we also want to move |
Yes |
Actually frictionless:::check_package() doesn't return TRUE, but nothing. And actually it 's what I expected by our function as well. I am working on this in #247 |
I think they should probably return something invisibly, similar to I chose On this note, we could use the on_failure() helper from assertthat, this is an example from their documentation; is_odd <- function(x) {
assert_that(is.numeric(x), length(x) == 1)
x %% 2 == 1
}
assert_that(is_odd(2))
# Error: is_odd(x = 2) is not TRUE
on_failure(is_odd) <- function(call, env) {
paste0(deparse(call$x), " is even")
}
assert_that(is_odd(2))
# Error: 2 is even
So, do we want |
Hi @PietrH. Behavior of assertthat seems to me ok. I was actually wrong in my previous comment. Or, let's say, not completely correct. The difference between our function and the Without the final So, I added back the |
Suggested in camtraptor July 2023 coding sprint
check_package()
currently returns the object itself, so it can be used in pipes, but this reads oddly. Rather,check_package()
should return TRUE, exactly how frictionless:::check_package() works.This change will effect the use in other functions. There it should be used as:
Not:
The text was updated successfully, but these errors were encountered: