HF-270: Exporter honours evaluateNullToZero for bare empty cells - #1738
Open
marcin-kordas-hoc wants to merge 1 commit into
Open
HF-270: Exporter honours evaluateNullToZero for bare empty cells#1738marcin-kordas-hoc wants to merge 1 commit into
marcin-kordas-hoc wants to merge 1 commit 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
Contributor
|
Task linked: HF-270 |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | 10e48b2 | Commit Preview URL Branch Preview URL |
Aug 14 2026, 12:36 PM |
Performance comparison of head (10e48b2) vs base (61ead73) |
marcin-kordas-hoc
marked this pull request as ready for review
August 18, 2026 05:48
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1738 +/- ##
===========================================
+ Coverage 97.31% 97.32% +0.01%
===========================================
Files 195 195
Lines 15719 15719
Branches 3455 3385 -70
===========================================
+ Hits 15297 15299 +2
- Misses 414 420 +6
+ Partials 8 0 -8
🚀 New features to boost your workflow:
|
Collaborator
Author
|
Paired tests PR: handsontable/hyperformula-tests#39 — merge it BEFORE this one. |
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.
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
Behavior change for export APIs when evaluateNullToZero is enabled may break code that relied on null to detect empty cells; default-off path is unchanged.
Overview
Fixes HF-270: when
evaluateNullToZerois enabled, the interpreter already treats empty cells as0inside formulas, butExporter.exportValuealways mappedEmptyValuetonull, so direct reads viagetCellValue,getSheetValues,getAllSheetsValues, andExportedCellChangestayed inconsistent (e.g.[[null, '=A1']]→[[null, 0]]).The
EmptyValuebranch now returns0whenconfig.evaluateNullToZerois true, otherwisenull. With the flag off or absent, export behaviour is unchanged.ISBLANKstill treats bare empty cells as blank either way.CHANGELOG documents the caveat: callers that used
nullfrom export APIs to distinguish truly empty cells from computed zero under this flag should useISBLANKinstead.Reviewed by Cursor Bugbot for commit 10e48b2. Bugbot is set up for automated code reviews on this repo. Configure here.