From 9df5170079e7045e1cccb3dfeb6dc3e69da4fb5d Mon Sep 17 00:00:00 2001 From: czgu Date: Tue, 13 Aug 2024 13:51:19 -0700 Subject: [PATCH] fix: Update task type to use str instead of enum (#1486) --- querybook/server/tasks/all_tasks.py | 2 +- querybook/server/tasks/disable_scheduled_docs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/querybook/server/tasks/all_tasks.py b/querybook/server/tasks/all_tasks.py index 609eac5ea..f91c66dcf 100644 --- a/querybook/server/tasks/all_tasks.py +++ b/querybook/server/tasks/all_tasks.py @@ -61,4 +61,4 @@ def configure_workers(sender=None, conf=None, **kwargs): @task_failure.connect def handle_task_failure(sender, signal, *args, **kwargs): task_type = get_schedule_task_type(sender.name) - stats_logger.incr(TASK_FAILURES, tags={"task_type": task_type}) + stats_logger.incr(TASK_FAILURES, tags={"task_type": task_type.value}) diff --git a/querybook/server/tasks/disable_scheduled_docs.py b/querybook/server/tasks/disable_scheduled_docs.py index 690baf8e5..ab1a35198 100644 --- a/querybook/server/tasks/disable_scheduled_docs.py +++ b/querybook/server/tasks/disable_scheduled_docs.py @@ -65,7 +65,7 @@ def get_scheduled_datadoc_tasks(session=None): .filter( TaskSchedule.enabled.is_(True), TaskSchedule.name.like(DATADOC_SCHEDULE_PREFIX + "%"), - TaskSchedule.task_type == ScheduleTaskType.USER, + TaskSchedule.task_type == ScheduleTaskType.USER.value, ) .all() )