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:
Asuka Minato 2025-09-06 04:32:23 +09:00 • committed by GitHub
commit a78339a040
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
306 changed files with 787 additions and 817 deletions

View file

@ -93,7 +93,7 @@ class CeleryWorkflowExecutionRepository(WorkflowExecutionRepository):
self._triggered_from,
)
def save(self, execution: WorkflowExecution) -> None:
def save(self, execution: WorkflowExecution):
"""
Save or update a WorkflowExecution instance asynchronously using Celery.

View file

@ -106,7 +106,7 @@ class CeleryWorkflowNodeExecutionRepository(WorkflowNodeExecutionRepository):
self._triggered_from,
)
def save(self, execution: WorkflowNodeExecution) -> None:
def save(self, execution: WorkflowNodeExecution):
"""
Save or update a WorkflowNodeExecution instance to cache and asynchronously to database.

View file

@ -176,7 +176,7 @@ class SQLAlchemyWorkflowExecutionRepository(WorkflowExecutionRepository):
return db_model
def save(self, execution: WorkflowExecution) -> None:
def save(self, execution: WorkflowExecution):
"""
Save or update a WorkflowExecution domain entity to the database.

View file

@ -194,9 +194,7 @@ class SQLAlchemyWorkflowNodeExecutionRepository(WorkflowNodeExecutionRepository)
"""Check if the exception is a duplicate key constraint violation."""
return isinstance(exception, IntegrityError) and isinstance(exception.orig, psycopg2.errors.UniqueViolation)
def _regenerate_id_on_duplicate(
self, execution: WorkflowNodeExecution, db_model: WorkflowNodeExecutionModel
) -> None:
def _regenerate_id_on_duplicate(self, execution: WorkflowNodeExecution, db_model: WorkflowNodeExecutionModel):
"""Regenerate UUID v7 for both domain and database models when duplicate key detected."""
new_id = str(uuidv7())
logger.warning(
@ -205,7 +203,7 @@ class SQLAlchemyWorkflowNodeExecutionRepository(WorkflowNodeExecutionRepository)
db_model.id = new_id
execution.id = new_id
def save(self, execution: WorkflowNodeExecution) -> None:
def save(self, execution: WorkflowNodeExecution):
"""
Save or update a NodeExecution domain entity to the database.
@ -254,7 +252,7 @@ class SQLAlchemyWorkflowNodeExecutionRepository(WorkflowNodeExecutionRepository)
logger.exception("Failed to save workflow node execution after all retries")
raise
def _persist_to_database(self, db_model: WorkflowNodeExecutionModel) -> None:
def _persist_to_database(self, db_model: WorkflowNodeExecutionModel):
"""
Persist the database model to the database.