[CHORE]: remove redundant-cast (#24807)

This commit is contained in:
willzhao
2025-09-01 14:05:32 +08:00
committed by GitHub
parent f11131f8b5
commit ffba341258
26 changed files with 54 additions and 90 deletions

View File

@@ -1,5 +1,5 @@
import uuid
from typing import cast
from typing import Optional
import pandas as pd
from flask_login import current_user
@@ -40,7 +40,7 @@ class AppAnnotationService:
if not message:
raise NotFound("Message Not Exists.")
annotation = message.annotation
annotation: Optional[MessageAnnotation] = message.annotation
# save the message annotation
if annotation:
annotation.content = args["answer"]
@@ -70,7 +70,7 @@ class AppAnnotationService:
app_id,
annotation_setting.collection_binding_id,
)
return cast(MessageAnnotation, annotation)
return annotation
@classmethod
def enable_app_annotation(cls, args: dict, app_id: str) -> dict: