Support for composite tasks
See original GitHub issueCurrent behavior
Currently, it appears there is no way to compose tasks.
Proposed behavior
I think this is a good example of where composite tasks would be useful:
@task
def read_table(path):
... # Load some tabular data structure
@task
def get_merged_tables(path1, path2):
t1 = read_table(path1)
t2 = read_table(path2)
return t1.join(t2)
Both read_csv
and get_merged_tables
are useful tasks on their own in this case, likely called individually from several different places in a pipeline. Is there a better workaround than the following or anything on the roadmap to this end?
def _read_table(path):
...
@task
def read_table(path):
return _read_table(path)
@task
def get_merged_tables(path1, path2):
t1 = _read_table(path1)
t2 = _read_table(path2)
return t1.join(t2)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Composite Task - an overview | ScienceDirect Topics
1. Partition the problem solution into tasks. · 2. Identify communication channels between the tasks. · 3. Aggregate tasks into composite tasks.
Read more >Creating a composite task - DBeaver Documentation
When creating a composite task, you need to specify which tasks the composite task consists of. This can be done: By adding an...
Read more >Scheduling Workflows With Composite Tasks: A Nested ...
To manage such complicated workflows, this article devises a novel workflow model with composite tasks (cWFS). The model views a complicated ...
Read more >Composing builds - Gradle User Manual
As well as consuming outputs via project dependencies, a composite build can directly declare task dependencies on included builds.
Read more >Prime Or Composite Task Cards Teaching Resources - TPT
Help build your students' understanding of prime and composite numbers with this set of 32 task cards and printables.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yep, makes sense. Calling
.run
seems reasonable for the former but I’m much more interested in the latter (nested dag structure). I don’t see any kind of extra computational expressivity that comes from it – I was only thinking that it’s a practical feature for big pipelines especially since one of my main interests in Prefect is the stuff that makes it easier to create tasks at a granular level. Finding the right balance is a little difficult IMO and I find myself reformulating tasks sometimes rather than keeping the conceptual model I’d like to have in order to fit the flat-dag layout.Got it. We’re tracking “subflows” (what we’re calling this kind of feature) in #1745, you can follow along there to see the conversation. Closing.