HF-270: Exporter honours evaluateNullToZero for bare empty cells - #1738
HF-270: Exporter honours evaluateNullToZero for bare empty cells#1738marcin-kordas-hoc wants to merge 2 commits into
Conversation
With evaluateNullToZero: true the interpreter already coerced empty -> 0 inside formulas, but the Exporter returned null for a bare empty cell read directly - getSheetValues over [[null, '=A1']] gave [[null, 0]]. The EmptyValue branch now returns 0 when the flag is on; default behaviour is byte-identical, ISBLANK still reports true. CHANGELOG names the caveat: code using null to distinguish truly-empty under this flag needs ISBLANK. Implemented by a prep-ship lane (task HF-270), loop green after 1 iteration; verified: authored specs 22/22, eslint clean, tsc clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PdHPZAjciZFWqGa19Yf7it
|
Task linked: HF-270 |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | b1c3f34 | Commit Preview URL Branch Preview URL |
Aug 31 2026, 05:19 AM |
Performance comparison of head (b1c3f34) vs base (114fd5d) |
|
Paired tests PR: handsontable/hyperformula-tests#39 — merge it BEFORE this one. |
# Conflicts: # CHANGELOG.md
|
@Tobiadefami — requesting your review. Write-up here: https://claude.ai/code/artifact/23606cf3-6e22-40e8-ab00-997780a674b9 (item 2) — includes the Stellar-Fusion-fork copyright note from the task description, worth reading before diving in. CI 34/34 green, 0 open threads. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1738 +/- ##
===========================================
+ Coverage 97.32% 97.33% +0.01%
===========================================
Files 195 195
Lines 15739 15739
Branches 3390 3391 +1
===========================================
+ Hits 15318 15320 +2
+ Misses 421 419 -2
🚀 New features to boost your workflow:
|
Tobiadefami
left a comment
There was a problem hiding this comment.
Looks good. Could we expand the evaluateNullToZero comment in ConfigParams.ts:120 to cover reading blank cells through the API? It currently describes only formula results.
Fixes HF-270: the
evaluateNullToZeroconfig option is honoured by the interpreter (a formula reading an empty cell already coerces empty → 0) but was ignored by the Exporter, which always returnednullfor a bare empty cell read directly — so with the flag on,getSheetValuesover[[null, '=A1']]gave[[null, 0]].What changed
The Exporter's
EmptyValuebranch returns0whenconfig.evaluateNullToZerois true,nullotherwise. Default behaviour (flag off/absent) is byte-identical.ISBLANKstill reportstruefor the bare empty cell either way. The CHANGELOG entry names the caveat: code relying onnullfromgetCellValueto distinguish truly-empty from computed-zero under this flag should useISBLANKinstead.Implemented independently from the task description (not taken from the fork referenced there).
Verification
Paired tests:
hyperformula-tests@spike/hf270-null-to-zero(22 assertions acrossgetCellValue/getSheetValues/ExportedCellChange/ ISBLANK / default-off).tsc --noEmitclean,eslint --quietclean.🤖 Generated with Claude Code
Note
Medium Risk
Changes observable API output for consumers with
evaluateNullToZero: true; default-off behavior is unchanged but callers relying onnullfor empty cells may need to adjust.Overview
Aligns exported cell values with formula evaluation when
evaluateNullToZerois enabled: bare empty cells now surface as0through the export layer instead of alwaysnull.Exporter.exportValuechecksconfig.evaluateNullToZeroonEmptyValueand returns0ornullaccordingly, sogetCellValue, sheet value getters, andExportedCellChangematch the interpreter’s empty→zero behavior. With the flag off, behavior is unchanged. Integrators who usednullfromgetCellValueto distinguish empty from zero under this flag should useISBLANKinstead.Reviewed by Cursor Bugbot for commit b1c3f34. Bugbot is set up for automated code reviews on this repo. Configure here.