d6tflow icon indicating copy to clipboard operation
d6tflow copied to clipboard

task not complete run option for data load

Open bacross opened this issue 5 years ago • 3 comments

Would like to see an option for the data load function to automatically run if task not marked complete. I find myself writing if else statements like the below to get the desired effect:

if TaskExample().complete: df = TaskExample().output()['df'].load() else: d6tflow.run(TaskExample()) df = TaskExample().output()['df'].load()

bacross avatar Dec 18 '19 01:12 bacross

How about asking the user if you want to run the task if it's not complete on load. Not sure if it should auto run.

For now suggest to always run d6tflow.run(TaskExample()) before loading any data. That will guarantee tasks are complete and no need for if statements.

d6tdev avatar Dec 31 '19 21:12 d6tdev

just a parameter option should be enough:

TaskExample().output()['df'].load(run_if_incomplete=True)

kind of a nice to have

bacross avatar Dec 31 '19 21:12 bacross

There a multiple issues that make this non-trivial to implement. 1) a target doesn't know which tasks it belongs to and 2) this could work better in Task().outputLoad(auto_run=True) but would lead to circular imports. TBD. For now suggest to always just run d6tflow.run(TaskExample()) if all tasks are complete this is fast.

d6tdev avatar Jan 02 '20 03:01 d6tdev