HF-160: ADDRESS drops the sheet separator when sheetName is empty - #1739
Open
marcin-kordas-hoc wants to merge 4 commits into
Open
HF-160: ADDRESS drops the sheet separator when sheetName is empty#1739marcin-kordas-hoc wants to merge 4 commits into
marcin-kordas-hoc wants to merge 4 commits into
Conversation
=ADDRESS(2,3,1,FALSE(),) returned '!R2C3' - the '!' separator was emitted for an empty-string sheet name. Excel returns 'R2C3'. One condition: an empty string no longer produces a sheet prefix, for both A1 and R1C1 styles; non-empty sheet names are untouched. Implemented by a prep-ship lane (task HF-160); the loop could not see its own green (harness path bug, prep-ship#1 follow-up) so verified here: authored spec 37/37, unit/interpreter 390 suites / 3531 tests green, tsc --noEmit clean, eslint clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PdHPZAjciZFWqGa19Yf7it
Contributor
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | dbab806 | Commit Preview URL Branch Preview URL |
Aug 31 2026, 07:14 AM |
Performance comparison of head (dbab806) vs base (114fd5d) |
marcin-kordas-hoc
marked this pull request as ready for review
August 18, 2026 05:49
Collaborator
Author
|
Paired tests PR: handsontable/hyperformula-tests#40 — merge it BEFORE this one. |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PdHPZAjciZFWqGa19Yf7it
# Conflicts: # CHANGELOG.md
… when absent Measured in Excel via the Graph API (three independent sessions, LEN()-proven), which contradicts this task's acceptance criteria: =ADDRESS(2,3,1,FALSE) -> R2C3 (LEN 4, no "!") =ADDRESS(2,3,1,FALSE,) -> R2C3 (LEN 4, no "!") =ADDRESS(2,3,1,FALSE,"") -> !R2C3 (LEN 5, keeps "!") =ADDRESS(2,3,1,FALSE,<empty cell ref>) -> !R2C3 (LEN 5, keeps "!") =ADDRESS(1,1,4,TRUE,"") -> !A1 (LEN 3, keeps "!") Excel distinguishes an argument that is syntactically absent from one that is present with an empty value. The AC asked for the separator to be dropped in all three empty-ish cases "consistently with Excel"; that premise holds for only one of them. The previous revision of this branch implemented the AC literally and regressed three cases that develop already got right, so this replaces it. The remaining real defect is the empty argument slot: a trailing comma reached the implementation as "" and produced a stray "!". Rather than hand-inspecting AstNodeType.EMPTY in the plugin, this adds an `emptyAsAbsent` argument-validation option next to the existing `emptyAsDefault`, so the distinction lives in the argument metadata and every function can opt in. ADDRESS's sheetName uses it. `emptyAsAbsent` is part of the custom-function metadata surface, so it is documented in docs/guide/custom-functions.md and the CHANGELOG. Verified: 6185/6189 jest tests pass. The single failure (=MOD(-7,2) in unit/function-metadata-api.spec.ts) reproduces on clean develop with clean develop tests and is unrelated: it is a stale golden expectation left by the MOD sign fix in #1752.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1739 +/- ##
========================================
Coverage 97.32% 97.32%
========================================
Files 195 195
Lines 15739 15742 +3
Branches 3390 3393 +3
========================================
+ Hits 15318 15321 +3
Misses 421 421
🚀 New features to boost your workflow:
|
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-160 (GH #1641):
=ADDRESS(2,3,1,FALSE(),)returned!R2C3— the sheet separator was emitted for an empty-string sheet name. Excel returnsR2C3.What changed
One condition in
AddressPlugin: an empty string no longer produces a sheet prefix, for both A1 and R1C1 styles. Non-empty sheet names keep producingSheet1!R2C3exactly as before.Verification
Paired tests:
hyperformula-tests@spike/hf160-address-sheetname(37 assertions: trailing-comma / explicit""/ omitted forms in both styles, non-empty names pinned unchanged). Fullunit/interpreter390 suites / 3531 tests green,tsc --noEmitclean,eslint --quietclean.🤖 Generated with Claude Code
Note
Low Risk
Behavior change is scoped behind the new
emptyAsAbsentflag; onlyADDRESSadopts it, with limited impact on the shared argument-coercion path.Overview
ADDRESSnow matches Excel for the optional sheet name: omitted or trailing-comma empty slots no longer add the!prefix (e.g.R2C3instead of!R2C3), while an explicit empty value (""or an empty cell) still keeps!.This is enabled by a new
emptyAsAbsentparameter flag on custom/built-in functions. InFunctionPlugin, syntactically empty argument slots can be passed through asundefinedinstead of type zero-values ("",0,FALSE), only whenemptyAsDefaultis not in play.ADDRESS’s fifth argument usesemptyAsAbsent: true.Docs and changelog describe the new option and the
ADDRESSfix.Reviewed by Cursor Bugbot for commit dbab806. Bugbot is set up for automated code reviews on this repo. Configure here.