Tim Galvin
01/28/2025, 6:59 AMfrom prefect import flow, task
@task
def task_my_funct():
...
however, there are times were the function we want to decorate is already defined elsewhere, or its not appropriate to decorate. In this case we can still use the decorator in line without the syntax sugar
from my_lib import my_func
task_my_funct = task(my_func)
This behaves as expected, but it really confuses the type checkers, which consider task_my_func
to be a variable.
Is there a way around this?