mirror of https://github.com/langgenius/dify.git
fix: typing
This commit is contained in:
parent
bfe0d14409
commit
e3c2345b21
|
|
@ -7,7 +7,7 @@ with support for different subscription tiers, rate limiting, and execution trac
|
|||
|
||||
import json
|
||||
from datetime import UTC, datetime
|
||||
from typing import Optional, Union
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
from celery.result import AsyncResult
|
||||
from sqlalchemy import select
|
||||
|
|
@ -152,7 +152,7 @@ class AsyncWorkflowService:
|
|||
# 9. Dispatch to appropriate queue
|
||||
task_data_dict = task_data.model_dump(mode="json")
|
||||
|
||||
task: AsyncResult | None = None
|
||||
task: AsyncResult[Any] | None = None
|
||||
if queue_name == QueuePriority.PROFESSIONAL:
|
||||
task = execute_workflow_professional.delay(task_data_dict) # type: ignore
|
||||
elif queue_name == QueuePriority.TEAM:
|
||||
|
|
@ -226,7 +226,7 @@ class AsyncWorkflowService:
|
|||
return cls.trigger_workflow_async(session, user, trigger_data)
|
||||
|
||||
@classmethod
|
||||
def get_trigger_log(cls, workflow_trigger_log_id: str, tenant_id: Optional[str] = None) -> Optional[dict]:
|
||||
def get_trigger_log(cls, workflow_trigger_log_id: str, tenant_id: Optional[str] = None) -> Optional[dict[str, Any]]:
|
||||
"""
|
||||
Get trigger log by ID
|
||||
|
||||
|
|
@ -249,7 +249,7 @@ class AsyncWorkflowService:
|
|||
@classmethod
|
||||
def get_recent_logs(
|
||||
cls, tenant_id: str, app_id: str, hours: int = 24, limit: int = 100, offset: int = 0
|
||||
) -> list[dict]:
|
||||
) -> list[dict[str, Any]]:
|
||||
"""
|
||||
Get recent trigger logs
|
||||
|
||||
|
|
@ -272,7 +272,9 @@ class AsyncWorkflowService:
|
|||
return [log.to_dict() for log in logs]
|
||||
|
||||
@classmethod
|
||||
def get_failed_logs_for_retry(cls, tenant_id: str, max_retry_count: int = 3, limit: int = 100) -> list[dict]:
|
||||
def get_failed_logs_for_retry(
|
||||
cls, tenant_id: str, max_retry_count: int = 3, limit: int = 100
|
||||
) -> list[dict[str, Any]]:
|
||||
"""
|
||||
Get failed logs eligible for retry
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from flask import request
|
|||
from pydantic import BaseModel
|
||||
from sqlalchemy import select
|
||||
from sqlalchemy.orm import Session
|
||||
from werkzeug.datastructures import FileStorage
|
||||
from werkzeug.exceptions import RequestEntityTooLarge
|
||||
|
||||
from configs import dify_config
|
||||
|
|
@ -324,7 +325,9 @@ class WebhookService:
|
|||
return body, {}
|
||||
|
||||
@classmethod
|
||||
def _process_file_uploads(cls, files, webhook_trigger: WorkflowWebhookTrigger) -> dict[str, Any]:
|
||||
def _process_file_uploads(
|
||||
cls, files: Mapping[str, FileStorage], webhook_trigger: WorkflowWebhookTrigger
|
||||
) -> dict[str, Any]:
|
||||
"""Process file uploads using ToolFileManager.
|
||||
|
||||
Args:
|
||||
|
|
|
|||
Loading…
Reference in New Issue