-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello.py
34 lines (26 loc) · 694 Bytes
/
hello.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
import time
from dagster import job, op, get_dagster_logger
logging = get_dagster_logger()
@op
def get_name(context):
name = context.op_config.get('name')
name1 = context.op_config.get('name1')
logging.info('name is:%s' % name)
return name
@op
def helloa(name):
logging.info("Hello-a, {name}!".format(name=name))
time.sleep(1)
@op
def hellob(name):
logging.info("Hello-b, {name}!".format(name=name))
time.sleep(1)
@job
def hello_dagster():
start = time.time()
name = get_name()
helloa(name)
hellob(name)
logging.info('Total time: %s' % (time.time() - start))
if __name__ == "__main__":
result = hello_dagster.execute_in_process()