haf
10/26/2021, 5:39 PM@task(result=...)
because I then have to specify the result type to be either local or GCS. How do you handle this?Anna Geller
from prefect import task, Flow
from prefect.engine.results import LocalResult, GCSResult
import sys
@task(log_stdout=True, checkpoint=True)
def hello_world():
print("hello world")
with Flow("flow-with-varying-results") as flow:
hw = hello_world()
if __name__ == "__main__":
local_run = sys.argv[1].lower()
if local_run == 'true':
flow.result = LocalResult()
flow.run()
else:
flow.result = GCSResult()
flow.register(project_name="community")
haf
10/26/2021, 7:26 PM