diff --git a/Changelog.md b/Changelog.md index dc4b052..5c24abe 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,12 +1,21 @@ -# Release 0.1.0 +# Changelog -## Features +## Release 0.2.0 + +### Features + +- add `update_task` method to `DAG` class + - update task parameters from `Task` instance + +## Release 0.1.0 + +### Features - add clear, get_return_value, get_all_tasks method to DAG class -# Release 0.0.1 +## Release 0.0.1 -## Features +### Features - First release - add operator and module for function scheduling \ No newline at end of file diff --git a/example.py b/example.py index db855e2..2fee1a4 100644 --- a/example.py +++ b/example.py @@ -17,7 +17,10 @@ def example_return_func(text): # or dag.set_downstream('function_task', 'condition_task') # dag.set_downstream('condition_task', 'iter_task') converter = Converter(dag) -converter.convert_list_to_dag(task_order).run('hello_task') + +dag.update_task(task_order[2], ['where are you from?']) + +converter.convert_list_to_dag(task_order).run(task_order[0]) # print return value of iter_task print(dag.get_return_value('iter_task')) diff --git a/f_scheduler/modules/dag.py b/f_scheduler/modules/dag.py index 9f2c8fb..be1c514 100644 --- a/f_scheduler/modules/dag.py +++ b/f_scheduler/modules/dag.py @@ -22,3 +22,10 @@ def get_return_value(self, task_id): def get_all_tasks(self): return self.tasks + + def update_task(self, task_id, new_param): + task = self.tasks[task_id] + if task: + task.param = new_param + else: + print(f"No task found with id: {task_id}") diff --git a/pyproject.toml b/pyproject.toml index 94c8111..d579951 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ exclude = ['f_scheduler*tests'] [project] name = "f-scheduler" -version = "0.1.0" +version = "0.2.0" description = "Simplify Function Scheduler with Python 3" authors = [ {name = "minwook-shin", email = "minwook0106@gmail.com"},