chore: apply ruff's pyupgrade linter rules to modernize Python code with targeted version (#2419)
This commit is contained in:
parent
589099a005
commit
063191889d
246 changed files with 912 additions and 937 deletions
|
|
@ -2,7 +2,7 @@ import datetime
|
|||
import logging
|
||||
import time
|
||||
import uuid
|
||||
from typing import List, cast
|
||||
from typing import cast
|
||||
|
||||
import click
|
||||
from celery import shared_task
|
||||
|
|
@ -19,7 +19,7 @@ from models.dataset import Dataset, Document, DocumentSegment
|
|||
|
||||
|
||||
@shared_task(queue='dataset')
|
||||
def batch_create_segment_to_index_task(job_id: str, content: List, dataset_id: str, document_id: str,
|
||||
def batch_create_segment_to_index_task(job_id: str, content: list, dataset_id: str, document_id: str,
|
||||
tenant_id: str, user_id: str):
|
||||
"""
|
||||
Async batch create segment to index
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import logging
|
||||
import time
|
||||
from typing import List
|
||||
|
||||
import click
|
||||
from celery import shared_task
|
||||
|
|
@ -11,7 +10,7 @@ from models.dataset import Dataset, Document, DocumentSegment
|
|||
|
||||
|
||||
@shared_task(queue='dataset')
|
||||
def clean_notion_document_task(document_ids: List[str], dataset_id: str):
|
||||
def clean_notion_document_task(document_ids: list[str], dataset_id: str):
|
||||
"""
|
||||
Clean document when document deleted.
|
||||
:param document_ids: document ids
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import datetime
|
||||
import logging
|
||||
import time
|
||||
from typing import List, Optional
|
||||
from typing import Optional
|
||||
|
||||
import click
|
||||
from celery import shared_task
|
||||
|
|
@ -15,7 +15,7 @@ from models.dataset import DocumentSegment
|
|||
|
||||
|
||||
@shared_task(queue='dataset')
|
||||
def create_segment_to_index_task(segment_id: str, keywords: Optional[List[str]] = None):
|
||||
def create_segment_to_index_task(segment_id: str, keywords: Optional[list[str]] = None):
|
||||
"""
|
||||
Async create segment to index
|
||||
:param segment_id:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import datetime
|
||||
import logging
|
||||
import time
|
||||
from typing import List, Optional
|
||||
from typing import Optional
|
||||
|
||||
import click
|
||||
from celery import shared_task
|
||||
|
|
@ -15,7 +15,7 @@ from models.dataset import DocumentSegment
|
|||
|
||||
|
||||
@shared_task(queue='dataset')
|
||||
def update_segment_index_task(segment_id: str, keywords: Optional[List[str]] = None):
|
||||
def update_segment_index_task(segment_id: str, keywords: Optional[list[str]] = None):
|
||||
"""
|
||||
Async update segment index
|
||||
:param segment_id:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue