Skip to content

Commit

Permalink
add update_task method to DAG class
Browse files Browse the repository at this point in the history
  • Loading branch information
minwook-shin committed Apr 19, 2024
1 parent ca00c36 commit b983fcf
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
17 changes: 13 additions & 4 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
7 changes: 7 additions & 0 deletions f_scheduler/modules/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit b983fcf

Please sign in to comment.