-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.py
More file actions
24 lines (18 loc) · 854 Bytes
/
hello.py
File metadata and controls
24 lines (18 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from digitalai.release.integration import BaseTask
from digitalai.release.integration import dai_logger
class Hello(BaseTask):
"""
The purpose of this task is to greet by the given name.
"""
def execute(self) -> None:
name = self.input_properties['yourName']
if not name:
raise ValueError("The 'name' field cannot be empty")
greeting = f"Hello {name}"
dai_logger.info(f"get_release_server_url() : {self.get_release_server_url()}")
dai_logger.info(f"get_task_user() : {self.get_task_user()}")
dai_logger.info(f"get_release_id() : {self.get_release_id()}")
dai_logger.info(f"get_task_id() : {self.get_task_id()}")
# Add to the comment section of the task in the UI
self.add_comment(greeting)
self.set_output_property('greeting', greeting)