Skip to content

fix(excel): preserve zero values when splitting workbooks - #180

Merged
CoderWanFeng merged 1 commit into
CoderWanFeng:developfrom
Karmeston:fix/excel-split-zero-values
Oct 14, 2026
Merged

CoderWanFeng merged 1 commit into
CoderWanFeng:developfrom
Karmeston:fix/excel-split-zero-values

Conversation

@Karmeston

Copy link
Copy Markdown
Contributor

Splitting an Excel workbook silently replaces valid zero and false values with spaces. For example, an XLSX row ['A', 0, False], split by its first column, becomes ['A', ' ', ' '] in worksheet A.

Both readers currently use truthiness to detect empty cells. This change checks explicitly for an empty string in XLS and None in XLSX, preserving zero values while keeping the existing handling of empty cells. XLSX booleans retain their type; XLS booleans continue to be handled as the 0/1 values returned by xlrd.

Validation: generated, split, and reopened real XLS and XLSX workbooks containing zero, false, true, empty cells, text, and negative numbers. Confirmed that zero/false values are retained and empty cells still become spaces. Both existing Excel wrapper tests passed.

@CoderWanFeng
CoderWanFeng merged commit 0a42cc7 into CoderWanFeng:develop Oct 14, 2026
CoderWanFeng pushed a commit that referenced this pull request Oct 26, 2026
发布 1.1.0:合入 #183 / #184 / #185 三个 PR,以及自 1.0.6 以来的全部修复。

主要内容:
- feat(cli): 第一波 CLI 实现 —— `po` 命令 (#184)
- feat(contributors): 5 个 Excel 数据核对与整理方法 (#185)
- feat(contributor): batch_rename_by_excel (#183)
- fix(excel): 拆分时保留 0 值 (#180)
- fix(finance): t0 的 Decimal/float TypeError (#181)
- fix(excel): 拆分输出工作簿有效性 (#182)
- 及其他 1.0.6 以来的修复与文档更新
- 合并 main 独有的 #141 / #155

版本号: 1.0.6 → 1.1.0
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.

2 participants