Repository navigation
This closes #2411, anchor the wildcard match of the lookup functions - #2418
Merged
Merged
Conversation
…tions `compareFormulaArg` used `matchPattern`, which reports any occurrence inside the cell. VLOOKUP, HLOOKUP and XLOOKUP therefore matched a substring and returned a value from the wrong row, without an error. qax-os#2267 applied the same anchoring to the SUMIF/COUNTIF criteria; `compareFormulaArg` is the other place that needs it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: PhilflowIO <tech@philflow.io>
xuri
requested changes
Oct 9, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2418 +/- ##
==========================================
- Coverage 99.72% 99.72% -0.01%
==========================================
Files 32 32
Lines 32480 32531 +51
==========================================
+ Hits 32391 32441 +50
- Misses 87 88 +1
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xuri
approved these changes
Oct 10, 2026
xuri
left a comment
Member
There was a problem hiding this comment.
Thanks for your pull request. I've made some changes based on your code branch.
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.
PR Details
Description
Adds
matchPatternWholeText, which matches the pattern against the whole text, and uses it in the wildcard branch ofcompareFormulaArg. Without a wildcard in the lookup value it compares the strings directly; with one it anchors the regular expression at both ends.matchPatternis left alone, so FIND and SEARCH keep reporting any occurrence.Related Issue
Closes #2411
Motivation and Context
compareFormulaArgusedmatchPattern, which reports any occurrence inside the cell. VLOOKUP, HLOOKUP and XLOOKUP therefore matched a substring and returned a value from the wrong row, without an error. #2267 applied the same anchoring to the SUMIF/COUNTIF criteria;compareFormulaArgis the other place that needs it.How Has This Been Tested
New test
TestCalcLookupWildcardMatch: exact matches, substring lookup values, the empty lookup value,*and?wildcards for VLOOKUP, HLOOKUP and XLOOKUP, and FIND/SEARCH to pin the unanchored behaviour they need.go test ./...passes on go1.26.8 linux/amd64.gofmt -s -l .is empty.Types of changes
Checklist