-
Notifications
You must be signed in to change notification settings - Fork 51
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
Better handling for bad column selections #497
Comments
Sorry @rich-iannone for accidentally introducing some weird behavior during tidyselect integration 😅. But these are good to know! I agree that this is a good opportunity to modernize this while we're at it. Just one follow-up Q: could we move forward treating I'll think through some of these edgecases more and try to tackle this in a separate PR (after merging the documentation PR and getting tidyselect for |
It's all good! There's so many moving parts here and you've navigated all of this really well. I do think the in-report💥 with those very cases would be ideal. We could even alter the error message that appears when hovering over the 💥 in this case. Thinking about this more deeply, I remember that Thanks for getting further in the weeds on this part of the package! |
columns = NULL
Closed by #499 |
I think the skipping behavior with
columns = NULL
on thecol_vals_*()
/col_is_*()
functions is new. I tried settingcolumns = NULL
withmain
(before the 2 PRs) and got an ugly error, which is undocumented and shouldn't really happen when using an agent.If you're up for it, this would be another chance for modernization of the API to use more tidyselect semantics. Right now in
main
,columns = NULL
results in a single, skipped validation step. That's better than before but I'm not certain it's what we want. We have anactive
argument that is better meant for that, where we could supply a logical or a function that should resolve to a logical (which I believe is in the same/similar scope as a function invoked aspreconditions
; the helper function ishas_columns()
and this is the PR that introduces it: #240). This work (should you choose to accept it!) can all be deferred to a non-documentation PR.Here are some examples, and I'll summarize what happens with
main
:^ skips. Probably not ideal, you get a weird autobrief (
"Expect that values in NA (computed column) ... "
)^ same result as before but more likely for the user to hit. It can be dangerous safety-wise to use tidyselect because the match can be arbitrary. Users should be advised to pair with a
has_columns()
check in theactive
argument.^ this ought to work but tidyselect is not yet ported to
active
/has_columns()
. So we get a console error withinterrogate()
(the error is not captured internally); we don't get a full validation report.^ The above two cases (with string-based column names or with
vars()
) work as before.^ doesn't work, but closer to a safety net that is useful.
This is a lot to sort though, so let me know if more work in this direction is worthwhile!
Originally posted by @rich-iannone in #496 (comment)
The text was updated successfully, but these errors were encountered: