d6tflow
d6tflow copied to clipboard
task not complete run option for data load
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()
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.
just a parameter option should be enough:
TaskExample().output()['df'].load(run_if_incomplete=True)
kind of a nice to have
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.