HF-160: ADDRESS drops the sheet separator when sheetName is empty - #1739
HF-160: ADDRESS drops the sheet separator when sheetName is empty#1739marcin-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
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) |
|
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.
|
@Tobiadefami — requesting your review. Write-up with the full context (requirement, decision, technical pass, verification) is here: https://claude.ai/code/artifact/23606cf3-6e22-40e8-ab00-997780a674b9 (item 1). 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 #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:
|
Tobiadefami
left a comment
There was a problem hiding this comment.
The implementation looks good, and the absent-versus-empty behavior matches the cases verified in Excel Online.
Could we update “What changed”? Explicit "" still retains the sheet prefix; omitted arguments and syntactically empty slots omit it.
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.