Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential Typo in the Docs - Define Upstream Dependency Tasks #39

Open
DOH-Manada opened this issue Aug 18, 2021 · 0 comments
Open

Potential Typo in the Docs - Define Upstream Dependency Tasks #39

DOH-Manada opened this issue Aug 18, 2021 · 0 comments

Comments

@DOH-Manada
Copy link

DOH-Manada commented 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.

# quick save one output
class TaskSingleOutput(d6tflow.tasks.TaskPqPandas):

    def run(self):
        self.save(data_output)

# no dependency
class TaskSingleInput(d6tflow.tasks.TaskPqPandas):
    #[...]

# single dependency
@d6tflow.requires(TaskSingleOutput)
class TaskSingleInput(d6tflow.tasks.TaskPqPandas):
    #[...]

# multiple dependencies
@d6tflow.requires({'input1':TaskSingleOutput1, 'input2':TaskSingleOutput2})
class TaskMultipleInput(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']
@DOH-Manada 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant