question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for composite tasks

See original GitHub issue

Current 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:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
eric-czechcommented, Jun 10, 2020

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.

0reactions
jcristcommented, Jul 16, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found