Use typing.Literal to replace str places (#24099)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Zhehao Peng
2025-08-18 06:34:13 -07:00
committed by GitHub
parent 670d479e32
commit c0702aacac
8 changed files with 34 additions and 26 deletions

View File

@@ -1,5 +1,6 @@
import logging
import time
from typing import Literal
import click
from celery import shared_task # type: ignore
@@ -13,7 +14,7 @@ from models.dataset import Document as DatasetDocument
@shared_task(queue="dataset")
def deal_dataset_vector_index_task(dataset_id: str, action: str):
def deal_dataset_vector_index_task(dataset_id: str, action: Literal["remove", "add", "update"]):
"""
Async deal dataset from index
:param dataset_id: dataset_id