[help] How to stop an outdated target from invalidating its downstream target? #1249
-
Help
DescriptionI have a list of connections that are used for collecting data. However, the number of connections will grow as the project grows, so what I'm trying to build is a rule such that
Because of this, I try to move my connections out of
This will result in a graph like this As you can see, even if I put |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
To make a target not rerun when its upstream dependencies change, you could supply But in general, file/database connection objects are not exportable. This means they do not easily ship to parallel workers. I would recommend creating each connection within the target itself, i.e.: run_target <- function() {
con <- create_connection()
out <- do_work(con)
close(con)
return(out)
} with: tar_target(your_target, run_target()) |
Beta Was this translation helpful? Give feedback.
To make a target not rerun when its upstream dependencies change, you could supply
cue = tar_cue(depend = FALSE)
totar_target()
.But in general, file/database connection objects are not exportable. This means they do not easily ship to parallel workers. I would recommend creating each connection within the target itself, i.e.:
with:
tar_target(your_target, run_target())