fix: auto-fix code issues (cron)

- 修复重复导入/字段
- 修复异常处理
- 修复PEP8格式问题
- 添加类型注解
This commit is contained in:
AutoFix Bot
2026-03-03 06:03:38 +08:00
parent 2a0ed6af4d
commit 9fd1da8fb7
41 changed files with 901 additions and 768 deletions

View File

@@ -178,7 +178,7 @@ class EntityAligner:
return best_match
def _fallback_similarity_match(
self, entities: list[object], name: str, exclude_id: str | None = None
self, entities: list[object], name: str, exclude_id: str | None = None,
) -> object | None:
"""
回退到简单的相似度匹配(不使用 embedding
@@ -212,7 +212,7 @@ class EntityAligner:
return None
def batch_align_entities(
self, project_id: str, new_entities: list[dict], threshold: float | None = None
self, project_id: str, new_entities: list[dict], threshold: float | None = None,
) -> list[dict]:
"""
批量对齐实体
@@ -232,7 +232,7 @@ class EntityAligner:
for new_ent in new_entities:
matched = self.find_similar_entity(
project_id, new_ent["name"], new_ent.get("definition", ""), threshold=threshold
project_id, new_ent["name"], new_ent.get("definition", ""), threshold=threshold,
)
result = {