[general] Improved reporting of branches #1306
Closed
multimeric
started this conversation in
General
Replies: 1 comment 13 replies
-
Hi @multimeric, I think workspaces ( tar_option_set(workspace_on_error = TRUE) Then if a dynamic branch fails, you can identify the saved "workspaces" with Lastly, if you want just the names of the upstream dependencies for branches, you can use tar_branches(target_name, pattern = <<enter pattern here>>) Lame example but showcases things: targets::tar_dir({
targets::tar_script({
library(targets)
foo <- function(x) {
if (x == 5) rlang::abort('Something went wrong')
x
}
tar_option_set(
workspace_on_error = TRUE,
error = 'continue'
)
list(
tar_target(
a,
1:10
),
tar_target(
b,
a,
pattern = map(a)
),
tar_target(
c,
foo(b),
pattern = map(b)
)
)
}, ask = FALSE)
targets::tar_make()
print(targets::tar_workspaces())
# Could load workspace with `tar_workspace("c_24be1142")`
targets::tar_branches(c, map(b))
})
#> ▶ dispatched target a
#> ● completed target a [0.001 seconds]
#> ▶ dispatched branch b_0a91b2ed
#> ● completed branch b_0a91b2ed [0 seconds]
#> ▶ dispatched branch b_847c5ae2
#> ● completed branch b_847c5ae2 [0 seconds]
#> ▶ dispatched branch b_1619f1a0
#> ● completed branch b_1619f1a0 [0 seconds]
#> ▶ dispatched branch b_9401bbb6
#> ● completed branch b_9401bbb6 [0 seconds]
#> ▶ dispatched branch b_d24115c8
#> ● completed branch b_d24115c8 [0 seconds]
#> ▶ dispatched branch b_fb63d300
#> ● completed branch b_fb63d300 [0 seconds]
#> ▶ dispatched branch b_3138aba9
#> ● completed branch b_3138aba9 [0 seconds]
#> ▶ dispatched branch b_ad3eda3e
#> ● completed branch b_ad3eda3e [0 seconds]
#> ▶ dispatched branch b_bf196919
#> ● completed branch b_bf196919 [0 seconds]
#> ▶ dispatched branch b_b0795e65
#> ● completed branch b_b0795e65 [0 seconds]
#> ● completed pattern b
#> ▶ dispatched branch c_66acaf33
#> ● completed branch c_66acaf33 [0 seconds]
#> ▶ dispatched branch c_02f9cbce
#> ● completed branch c_02f9cbce [0.001 seconds]
#> ▶ dispatched branch c_c46c3a46
#> ● completed branch c_c46c3a46 [0 seconds]
#> ▶ dispatched branch c_0b5d87dc
#> ● completed branch c_0b5d87dc [0 seconds]
#> ▶ dispatched branch c_24be1142
#> ▶ recorded workspace c_24be1142
#> ✖ errored branch c_24be1142
#> Error: Something went wrong
#>
#> ▶ dispatched branch c_0ff7342d
#> ● completed branch c_0ff7342d [0 seconds]
#> ▶ dispatched branch c_7de5013b
#> ● completed branch c_7de5013b [0 seconds]
#> ▶ dispatched branch c_54814e50
#> ● completed branch c_54814e50 [0 seconds]
#> ▶ dispatched branch c_241b47cd
#> ● completed branch c_241b47cd [0.001 seconds]
#> ▶ dispatched branch c_419518f2
#> ● completed branch c_419518f2 [0 seconds]
#> ✖ errored pipeline [0.167 seconds]
#> [1] "c_24be1142"
#> # A tibble: 10 × 2
#> c b
#> <chr> <chr>
#> 1 c_66acaf33 b_0a91b2ed
#> 2 c_02f9cbce b_847c5ae2
#> 3 c_c46c3a46 b_1619f1a0
#> 4 c_0b5d87dc b_9401bbb6
#> 5 c_24be1142 b_d24115c8
#> 6 c_0ff7342d b_fb63d300
#> 7 c_7de5013b b_3138aba9
#> 8 c_54814e50 b_ad3eda3e
#> 9 c_241b47cd b_bf196919
#> 10 c_419518f2 b_b0795e65 |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Help
Description
I have a lot of dynamic branches, and my workflow often involves debugging errors in particular branches but not others. When I get a failure in one branch, it says something like
▶ dispatched branch instance_path_44d946c111c4f3e1
, and then it fails. However I'm not sure how to work backwards to determine which values of each upstream dependency were used in that branch. This is particularly bad in cases where the task fails outside of the command (e.g. here), because then I don't even get a traceback.I wonder if I could request a
reporter
that prints out the values of each dependency for dynamic branches. So it says something like:Beta Was this translation helpful? Give feedback.
All reactions