Add initial Prefect flow
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
__pycache__/
|
||||
*.pyc
|
||||
17
test_flows/hello_world.py
Normal file
17
test_flows/hello_world.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from prefect import flow, task
|
||||
import time
|
||||
|
||||
@task
|
||||
def say_hello(name: str) -> str:
|
||||
message = f"Hello, {name}!"
|
||||
print(message)
|
||||
return message
|
||||
|
||||
@flow(name="example-flow")
|
||||
def example_flow(name: str = "World"):
|
||||
result = say_hello(name)
|
||||
time.sleep(2) # Simuliere Arbeit
|
||||
return result
|
||||
|
||||
if __name__ == "__main__":
|
||||
example_flow()
|
||||
Reference in New Issue
Block a user