Skip to content

fix parse_link for link-display-single-select when export excel - #901

Merged
freeplant merged 1 commit into
masterfrom
fix-export-excel-parse-link
Aug 10, 2026
Merged

freeplant merged 1 commit into
masterfrom
fix-export-excel-parse-link

Conversation

@AlexCXC

@AlexCXC AlexCXC commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@seafile-dev seafile-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: Comment

Warnings:

  • Missing regression coverage for the newly supported scalar dtable-db link values (see inline comment).
    Suggested fix: add focused parse_link tests covering both legacy dict values and scalar option IDs, including multiple linked records, and assert their exported display names.

id2name = {op.get('id'): op.get('name') for op in options}
return ', '.join([select_option_to_name(id2name, cell) for cell in cell_data])
return ', '.join([
select_option_to_name(id2name, cell) if isinstance(cell, dict)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[Warning] 缺少混合数据形态回归测试

Why this matters:
本次修复依赖 dtable-db 返回的链接值既可能是旧的 dict,也可能是单选 option ID 字符串;该分支是此次 Excel 导出丢行问题的核心,但仓库中没有覆盖 parse_link 的测试。后续调整 option 映射或空值处理时,可能重新触发导出失败或输出错误标签而 CI 未发现。

Suggested fix: 为 parse_link 增加参数化测试:同时覆盖 dict 与字符串 option ID、多个链接记录,并断言均导出对应的 option name。

@freeplant
freeplant merged commit bbb1b03 into master Aug 10, 2026
1 check passed
@freeplant
freeplant deleted the fix-export-excel-parse-link branch August 10, 2026 08:09
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