init
This commit is contained in:
23
test2.py
Normal file
23
test2.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import datetime
|
||||||
|
from prefect import flow, task
|
||||||
|
import time
|
||||||
|
import requests
|
||||||
|
|
||||||
|
@task(name="My Example Task",
|
||||||
|
description="An example task for a tutorial.",
|
||||||
|
task_run_name="hello-{name}-on-{date:%A}")
|
||||||
|
def my_task(name, date):
|
||||||
|
|
||||||
|
res = requests.get("http://ipinfo.io").text
|
||||||
|
print(res)
|
||||||
|
time.sleep(60)
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@flow
|
||||||
|
def my_flow():
|
||||||
|
# creates a run with a name like "hello-marvin-on-Thursday"
|
||||||
|
my_task(name="marvin", date=datetime.datetime.now(datetime.timezone.utc))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
my_flow()
|
||||||
Reference in New Issue
Block a user