Skip to content

Partial branch invalidity/downloading a time series #591

Closed Answered by wlandau
tel asked this question in Help
Discussion options

You must be logged in to vote

If this download task is triggered monolithically then all downstream tasks will get invalidated daily...

It's actually possible to avoid most of that invalidation without getting too low-level. Sketch:

# _targets.R file
library(targets)
library(tarchetypes)
list(
  tar_group_by(
    name = large_dataset,
    command = download_full_dataset(),
    product_column,
    month_column,
    cue = tar_cue_age(large_dataset, as.difftime(1, units = "days"))
  ),
  tar_target(
    name = analysis,
    command = analyze_subset(large_dataset),
    pattern = map(large_dataset)
  )
)

The full dataset will download every day, but the branches of analysis will not rerun if the corresponding row groups…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tel
Comment options

Answer selected by tel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants