Skip to content

fix: 转换导入数据列名为字符串以兼容UI#230

Merged
WSXYT merged 2 commits into
masterfrom
seer/fix/convert-import-column-names-to-string
May 8, 2026
Merged

fix: 转换导入数据列名为字符串以兼容UI#230
WSXYT merged 2 commits into
masterfrom
seer/fix/convert-import-column-names-to-string

Conversation

@seer-by-sentry
Copy link
Copy Markdown
Contributor

@seer-by-sentry seer-by-sentry Bot commented May 8, 2026

Fixes SECRANDOM-AS. The issue was that: DataFrame column names are integers, but code attempts access using string representations from UI, causing KeyError.

  • 确保导入学生数据时,所有列名都被转换为字符串类型。
  • 避免因整数列名与UI层字符串期望不匹配而导致的问题。

This fix was generated by Seer in Sentry, triggered by wsxyt. 👁️ Run ID: 1259156

Not quite right? Click here to continue debugging with Seer.

@WSXYT WSXYT marked this pull request as ready for review May 8, 2026 16:50
Copilot AI review requested due to automatic review settings May 8, 2026 16:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

修复导入学生数据时 DataFrame 列名为整数、而 UI 层按字符串列名访问导致的 KeyError 问题,以提升导入功能与 UI 列映射的兼容性。

Changes:

  • 在文件导入完成后,将 DataFrame 的所有列名统一转换为字符串,避免 UI 字符串列名与底层整数列名不匹配。
  • 细微调整日志行(当前变更包含行尾字符差异)。

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

)
else:
logger.info(f"已保存 {len(all_students)} 名学生到新班级 '{class_name}'")
logger.info(f"已保存 {len(all_students)} 名学生到新班级 '{class_name}'")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已按反馈修复,移除了该处多余的 CR 行尾字符,当前仅保留正常换行格式。对应提交:bd80e72。本次没有 UI 变更,因此无截图。

@WSXYT WSXYT merged commit c7131f9 into master May 8, 2026
7 of 8 checks passed
Copilot stopped work on behalf of WSXYT due to an error May 8, 2026 16:56
@WSXYT WSXYT deleted the seer/fix/convert-import-column-names-to-string branch May 8, 2026 16:56
Copilot AI requested a review from WSXYT May 8, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants