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:
parent
670d479e32
commit
c0702aacac
8 changed files with 34 additions and 26 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue