mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
remove bare list, dict, Sequence, None, Any (#25058)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
@ -14,7 +14,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@shared_task(queue="conversation")
|
||||
def delete_conversation_related_data(conversation_id: str) -> None:
|
||||
def delete_conversation_related_data(conversation_id: str):
|
||||
"""
|
||||
Delete related data conversation in correct order from datatbase to respect foreign key constraints
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
def send_deletion_success_task(to: str, language: str = "en-US") -> None:
|
||||
def send_deletion_success_task(to: str, language: str = "en-US"):
|
||||
"""
|
||||
Send account deletion success email with internationalization support.
|
||||
|
||||
@ -46,7 +46,7 @@ def send_deletion_success_task(to: str, language: str = "en-US") -> None:
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
def send_account_deletion_verification_code(to: str, code: str, language: str = "en-US") -> None:
|
||||
def send_account_deletion_verification_code(to: str, code: str, language: str = "en-US"):
|
||||
"""
|
||||
Send account deletion verification code email with internationalization support.
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
def send_change_mail_task(language: str, to: str, code: str, phase: str) -> None:
|
||||
def send_change_mail_task(language: str, to: str, code: str, phase: str):
|
||||
"""
|
||||
Send change email notification with internationalization support.
|
||||
|
||||
@ -43,7 +43,7 @@ def send_change_mail_task(language: str, to: str, code: str, phase: str) -> None
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
def send_change_mail_completed_notification_task(language: str, to: str) -> None:
|
||||
def send_change_mail_completed_notification_task(language: str, to: str):
|
||||
"""
|
||||
Send change email completed notification with internationalization support.
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
def send_email_code_login_mail_task(language: str, to: str, code: str) -> None:
|
||||
def send_email_code_login_mail_task(language: str, to: str, code: str):
|
||||
"""
|
||||
Send email code login email with internationalization support.
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
def send_invite_member_mail_task(language: str, to: str, token: str, inviter_name: str, workspace_name: str) -> None:
|
||||
def send_invite_member_mail_task(language: str, to: str, token: str, inviter_name: str, workspace_name: str):
|
||||
"""
|
||||
Send invite member email with internationalization support.
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
def send_owner_transfer_confirm_task(language: str, to: str, code: str, workspace: str) -> None:
|
||||
def send_owner_transfer_confirm_task(language: str, to: str, code: str, workspace: str):
|
||||
"""
|
||||
Send owner transfer confirmation email with internationalization support.
|
||||
|
||||
@ -52,7 +52,7 @@ def send_owner_transfer_confirm_task(language: str, to: str, code: str, workspac
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
def send_old_owner_transfer_notify_email_task(language: str, to: str, workspace: str, new_owner_email: str) -> None:
|
||||
def send_old_owner_transfer_notify_email_task(language: str, to: str, workspace: str, new_owner_email: str):
|
||||
"""
|
||||
Send old owner transfer notification email with internationalization support.
|
||||
|
||||
@ -93,7 +93,7 @@ def send_old_owner_transfer_notify_email_task(language: str, to: str, workspace:
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
def send_new_owner_transfer_notify_email_task(language: str, to: str, workspace: str) -> None:
|
||||
def send_new_owner_transfer_notify_email_task(language: str, to: str, workspace: str):
|
||||
"""
|
||||
Send new owner transfer notification email with internationalization support.
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@shared_task(queue="mail")
|
||||
def send_reset_password_mail_task(language: str, to: str, code: str) -> None:
|
||||
def send_reset_password_mail_task(language: str, to: str, code: str):
|
||||
"""
|
||||
Send reset password email with internationalization support.
|
||||
|
||||
|
||||
@ -395,7 +395,7 @@ def delete_draft_variables_batch(app_id: str, batch_size: int = 1000) -> int:
|
||||
return total_deleted
|
||||
|
||||
|
||||
def _delete_records(query_sql: str, params: dict, delete_func: Callable, name: str) -> None:
|
||||
def _delete_records(query_sql: str, params: dict, delete_func: Callable, name: str):
|
||||
while True:
|
||||
with db.engine.begin() as conn:
|
||||
rs = conn.execute(sa.text(query_sql), params)
|
||||
|
||||
@ -120,7 +120,7 @@ def _create_workflow_run_from_execution(
|
||||
return workflow_run
|
||||
|
||||
|
||||
def _update_workflow_run_from_execution(workflow_run: WorkflowRun, execution: WorkflowExecution) -> None:
|
||||
def _update_workflow_run_from_execution(workflow_run: WorkflowRun, execution: WorkflowExecution):
|
||||
"""
|
||||
Update a WorkflowRun database model from a WorkflowExecution domain entity.
|
||||
"""
|
||||
|
||||
@ -140,9 +140,7 @@ def _create_node_execution_from_domain(
|
||||
return node_execution
|
||||
|
||||
|
||||
def _update_node_execution_from_domain(
|
||||
node_execution: WorkflowNodeExecutionModel, execution: WorkflowNodeExecution
|
||||
) -> None:
|
||||
def _update_node_execution_from_domain(node_execution: WorkflowNodeExecutionModel, execution: WorkflowNodeExecution):
|
||||
"""
|
||||
Update a WorkflowNodeExecutionModel database model from a WorkflowNodeExecution domain entity.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user