Created
July 15, 2020 20:15
-
-
Save lukeorland/dd0b183832aea1f2f725b596b1f095fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import prefect | |
from prefect import Flow, Parameter, task | |
@task | |
def func_factory(): | |
def func(): | |
prefect.context.get('logger').info('this is a func') | |
return func | |
@task | |
def call_func(func): | |
prefect.context.get('logger').info(f'calling function {func.__name__}') | |
func() | |
with Flow('function_as_prefect_task_result') as flow: | |
new_func = func_factory() | |
call_func(new_func) | |
flow.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment