You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This following code defines a single output task and calls it as a dependency to other tasks. Yet TaskSingleOutput1 & TaskSingleOutput2 are not defined anywhere on this page.
# quick save one outputclassTaskSingleOutput(d6tflow.tasks.TaskPqPandas):
defrun(self):
self.save(data_output)
# no dependencyclassTaskSingleInput(d6tflow.tasks.TaskPqPandas):
#[...]# single dependency@d6tflow.requires(TaskSingleOutput)classTaskSingleInput(d6tflow.tasks.TaskPqPandas):
#[...]# multiple dependencies@d6tflow.requires({'input1':TaskSingleOutput1, 'input2':TaskSingleOutput2})classTaskMultipleInput(d6tflow.tasks.TaskPqPandas):
#[...]
Also, it should be made clear in something like this example that the child keys are labeled in the persist, and the parent keys are defined in the dependency call.
# multiple dependencies, single & multiple outputs
@d6tflow.requires({'input1':TaskSingleOutput, 'input2':TaskMultipleOutput})
class TaskMultipleInput(d6tflow.tasks.TaskPqPandas):
def run(self):
data = self.inputLoad(as_dict=True)
data1a = data['input1'] # We reference the key defined in the dependency call
data2a = data['input2']['output1'] # 'output1' is a persist label defined in TaskMultipleOutput
data2b = data['input2']['output2']
The text was updated successfully, but these errors were encountered:
DOH-Manada
changed the title
Potential Typo in the Docs - Define Upstream Dependency Tasks & Relevant Question
Potential Typo in the Docs - Define Upstream Dependency Tasks
Aug 18, 2021
https://d6tflow.readthedocs.io/en/latest/tasks.html
This following code defines a single output task and calls it as a dependency to other tasks. Yet TaskSingleOutput1 & TaskSingleOutput2 are not defined anywhere on this page.
Also, it should be made clear in something like this example that the child keys are labeled in the persist, and the parent keys are defined in the dependency call.
The text was updated successfully, but these errors were encountered: