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

improve error when outcome is missing #1016

Merged
merged 2 commits into from
Nov 3, 2023
Merged

improve error when outcome is missing #1016

merged 2 commits into from
Nov 3, 2023

Conversation

simonpcouch
Copy link
Contributor

Closes #1003. :)

@@ -354,6 +354,16 @@ check_outcome <- function(y, spec) {
return(invisible(NULL))
}

has_no_outcome <- if (is.atomic(y)) {is.null(y)} else {length(y) == 0}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For is.atomic(y), note is.atomic(NULL) is TRUE, and for length(y) == 0, y can either be a list or tibble.

R/misc.R Show resolved Hide resolved
NEWS.md Outdated Show resolved Hide resolved
Co-authored-by: Emil Hvitfeldt <[email protected]>
@simonpcouch simonpcouch merged commit b462f76 into main Nov 3, 2023
7 checks passed
@simonpcouch simonpcouch deleted the error-1003 branch November 3, 2023 17:04
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

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

Successfully merging this pull request may close these issues.

Better error message if outcome has 0 columns
2 participants