You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And we can see, I had access to lm and lm.fit, where the error is occurring.
IMHO this is a real shame as recover was a really efficient technique for jumping to the source of an error and tinkering with offending code to understand why it was breaking. In the latest dplyr we do get a handy error message:
Error: Problem with `mutate()` input `model`.
x 0 (non-NA) cases
i Input `model` is `map(data, ~lm(mpg ~ cyl + hp + wt, data = .x))`.
i The error occured in group 6: carb = 8.
Run `rlang::last_error()` to see where the error occurred.
Which points me to the group that caused the problem. But I still have to write code to go inspect that group to figure out what is going on, e.g. mtc %>% filter(carb == 8). In this case it might be enough, but in more complex cases, like the second error I debug in the video, and the case I just had today it won't be.
I'm looking at writing a lot of code, overloading other people's functions, and messing around with environments to get to a situation where I can debug an error right at the point it fails.
I had a look at rlang::last_error and it seems like it almost has all the pieces I'd need to re-run the offending function with debugOnce. So that got me thinking that maybe rlang could bring this facility back with something like rlang::debug_last_error. That might be jumping the gun though. Maybe I am just stuck in the old way of doing things.
Is there another pathway to get to interactive debugging with dplyr, like what I was doing with recover?
The text was updated successfully, but these errors were encountered:
We should rethrow errors from a calling handler rather than an exiting handler. This way the stack is still around when it reaches the global handlers like options(error = ).
I've noticed that
recover = TRUE
is now seemingly unusable with dplyr.For example this code
Produces this stack of frames:
And I haven't been able to actually find the call to
lm
burried in there, since I seem to hit some c code inmutate_cols
that breaks the chain.Just shy of a year ago I made a video of myself debugging this error with recover. So we can look at what the stack of frames was then:
And we can see, I had access to
lm
andlm.fit
, where the error is occurring.IMHO this is a real shame as
recover
was a really efficient technique for jumping to the source of an error and tinkering with offending code to understand why it was breaking. In the latestdplyr
we do get a handy error message:Which points me to the group that caused the problem. But I still have to write code to go inspect that group to figure out what is going on, e.g.
mtc %>% filter(carb == 8)
. In this case it might be enough, but in more complex cases, like the second error I debug in the video, and the case I just had today it won't be.I'm looking at writing a lot of code, overloading other people's functions, and messing around with environments to get to a situation where I can debug an error right at the point it fails.
I had a look at
rlang::last_error
and it seems like it almost has all the pieces I'd need to re-run the offending function with debugOnce. So that got me thinking that mayberlang
could bring this facility back with something likerlang::debug_last_error
. That might be jumping the gun though. Maybe I am just stuck in the old way of doing things.Is there another pathway to get to interactive debugging with
dplyr
, like what I was doing withrecover
?The text was updated successfully, but these errors were encountered: