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

Provide more helpful feedback on epi_slide length/nrow mismatches #351

Closed
brookslogan opened this issue Jul 25, 2023 · 2 comments
Closed
Assignees
Labels
P0 high priority REPL Improved print, errors, etc.

Comments

@brookslogan
Copy link
Contributor

brookslogan commented Jul 25, 2023

Currently, we get errors like

Error in `Abort()`:
! The slide computations must either (a) output a single element/row
each, or (b) one element/row per appearance of the reference time value in the
local window.

There are two issues:

  1. The error shouldn't be "in Abort()"; we should use something like call = caller_env() in the abort call inside Abort (part of Augment Abort & co.; add rlang condition tutorial, helpers #102 but that's a large, stale WIP), or use cli_abort instead.
  2. This doesn't give very helpful info about what computation(s) output the wrong number of elements/rows. We could pack the slide computations list and the expected counts in an error object & refer to them in the error message, and/or print the first one with a violation of the existing pattern.
@dshemetov
Copy link
Contributor

I believe this implicitly handled by #519 (and/or adjacent PRs), by forcing epi_slide .f to return a single row. Are we happy with the error messages around that now?

@brookslogan
Copy link
Contributor Author

The changes you noted seem like they addresses part 2., and cli_abort addressed part 1, for epi_slide. And for epix_slide allowing any number of elements/rows out solved this message being unclear by eliminating it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 high priority REPL Improved print, errors, etc.
Projects
None yet
Development

No branches or pull requests

3 participants