Repository navigation
fix: Excel 列数不匹配时返回 400 - #1421
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
术语配置或 SQL 示例库上传列数不足、空工作表的 Excel 时,响应由 HTTP 500 改为 HTTP 400,保留原有“EXCEL列数量不匹配”及各语言提示。
两处校验仍在批量写入之前执行,列数规则和正常导入行为不变。
Evidence
6d57f075上,新增 8 个用例全部失败;中文请求复现 HTTP 500 +"EXCEL列数量不匹配"。tests/test_excel_http_errors.py共 31 个用例通过,包括两类导入的少列、空表、中英文提示、拒绝后不执行批量写入,以及既有合法导入和下载对照。backend/执行:LOG_FORMAT='%(levelname)s %(message)s' uv run --no-sync pytest -q tests/test_excel_http_errors.py --tb=short --show-capture=no --disable-warnings uv run --no-sync ruff check tests/test_excel_http_errors.py uv run --no-sync ruff format --check tests/test_excel_http_errors.pygit diff --check通过。两个业务文件既有 lint/格式问题与基线一致,未新增诊断。Merge Danger
Door: two-way
无迁移或依赖升级,可直接回退。
Blast Radius: Excel
列数校验失败恢复为客户端错误 400;提示内容和成功响应保持不变。