datachain icon indicating copy to clipboard operation
datachain copied to clipboard

Avoid running a chain if there are no changes at its sources

Open shcheklein opened this issue 1 year ago • 2 comments

It's quite common that I these days do this:

if "dclm-raw-text" not in datasets:
   (
      DataChain.from_dataset("dclm-index")
         .settings(cache=True)
         .limit(1)
         .gen(extract, output={"file": File, "json": dict})
         .save("dclm-raw-text")
   )

to avoid running that code again if the dataset is ready.

The downside is that I still need to run it from time to time (e.g. I change params, or something changed at it's source - dclm-index in this case).

I think we can make save() analyze the dependencies (including the query) and avoid running (by a flag or default?).

It brings a great additional value compared to basic data processing libs - our ability to analyze the graph of dependencies.

shcheklein avatar Nov 16 '24 20:11 shcheklein

It seems like a good problem to solve. AT the same time it feels that it will require a higher level abstraction like "task" or "step". It would be great to brainstorm this a bit.

dmpetrov avatar Nov 19 '24 19:11 dmpetrov

@ilongin this might be related to the incremental updates story.

shcheklein avatar Jan 09 '25 22:01 shcheklein

Solved with delta updates now.

shcheklein avatar Aug 17 '25 17:08 shcheklein