question: is doing `.run(...)` on a task within a ...
# prefect-community
c
question: is doing
.run(...)
on a task within a task an antipattern?
example:
Copy code
@task
def do_other_stuff(name: str)
  return f"hello {name}"

@task
def do_stuff():
  result = do_other_stuff.run("christian")
k
It’s not. Just know it’s not a first class task with retries and results and state tracking. It’s just the python under the hood.
c
gotcha!
so related: is this a way to create a general "helper" function to "say_hello"?
Copy code
@task
def generate_name():
  return "christian"

@task
def generate_hello(name: str):
  return f"hello {name}"

def say_hello():
  name = generate_name()
  hello = generate_hello(name)
  return hello

with Flow(...):
  response = say_hello()
k
Yeah that is fine. Not sure if you need the return but that will work!