diff --git a/petercat_utils/rag_helper/task.py b/petercat_utils/rag_helper/task.py index 162c1e83..1153795a 100644 --- a/petercat_utils/rag_helper/task.py +++ b/petercat_utils/rag_helper/task.py @@ -62,7 +62,7 @@ def get_task(task_type: TaskType, task_id: str) -> GitTask: .execute()) if len(response.data) > 0: data = response.data[0] - if task_type is TaskType.GIT_DOC: + if task_type == TaskType.GIT_DOC: return GitDocTask( id=data["id"], commit_id=data["commit_id"], @@ -74,7 +74,7 @@ def get_task(task_type: TaskType, task_id: str) -> GitTask: status=data["status"], from_id=data["from_task_id"] ) - if task_type is TaskType.GIT_ISSUE: + if task_type == TaskType.GIT_ISSUE: return GitIssueTask( id=data["id"], issue_id=data["issue_id"], diff --git a/pyproject.toml b/pyproject.toml index 0dfe70b8..369a4561 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "petercat_utils" -version = "0.1.26" +version = "0.1.27" description = "" authors = ["raoha.rh "] readme = "README.md" diff --git a/subscriber/handler.py b/subscriber/handler.py index adc20bbe..84ba74e7 100644 --- a/subscriber/handler.py +++ b/subscriber/handler.py @@ -1,6 +1,7 @@ import json from petercat_utils import task as task_helper +from petercat_utils.data_class import TaskType def lambda_handler(event, context): @@ -16,7 +17,7 @@ def lambda_handler(event, context): message_dict = json.loads(body) task_id = message_dict["task_id"] task_type = message_dict["task_type"] - task = task_helper.get_task(task_type, task_id) + task = task_helper.get_task(TaskType(task_type), task_id) if task is None: return task task.handle()