-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_description.py
48 lines (36 loc) · 1008 Bytes
/
test_description.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from prefect import flow, serve
from prefect_aws.s3 import S3Bucket
import random
s3_bucket_block = S3Bucket.load("s3")
@flow(persist_result=True,
result_storage=s3_bucket_block)
def addition(a:int=1, b:int=2) -> int:
"""Adds two numbers together
Args:
a (int): first num
b (int): second num
Returns:
int: a+b
Examples:
>>> addition(2+3)
5
"""
return a + b
@flow(persist_result=True,
result_storage=s3_bucket_block)
def generatenumber(random_seed:int) -> int:
"""
Generates a random number
Args:
random_seed (int): seed for the random number generator
Returns:
int: a random number
Examples:
>>> generate_number(1)
5
"""
return random.randint(1, 100)
if __name__=="__main__":
addition_deploy = addition.to_deployment(name="addition")
generate_number_deploy = generatenumber.to_deployment(name="generatenumber")
serve(addition_deploy, generate_number_deploy)