Skip to content

fix(vm): stop warning once per entity on BETWEEN with an unsupported left-hand type - #61

Merged
junichi-cstk merged 1 commit into
masterfrom
fix/quiet-between-unsupported-type
Oct 2, 2026
Merged

junichi-cstk merged 1 commit into
masterfrom
fix/quiet-between-unsupported-type

Conversation

@junichi-cstk

Copy link
Copy Markdown
Contributor

What changes

lio's metaforarunner is logging this warning in large volumes:

between not implemented for type map[string]time &expr.TriNode{...}

The warning comes from walkTernary whenever BETWEEN's left-hand value is a type the VM can't range-compare (a map, slice or string). Filters are evaluated once per entity, so a single audience with some_map_field BETWEEN "a" AND "b" logs one line for every profile it scans.

This PR removes the log line. The evaluation result doesn't change.

Left-hand value Before After
int / number / time compared compared (unchanged)
map, slice, string (nil, false) + a warning per evaluation (nil, false), nothing logged

This matches evalBinary, which already returns (nil, false) silently for a map compared with < or >.

Why the filters exist

lio's audience builder (lytics-ui) could save BETWEEN on a whole map[string]time field when no key was picked. That path was fixed in lytics-ui #5133 / #5147. A separate lio change will reject the shape when an audience is saved, and audiences already saved with it still need cleaning up. This PR only removes the log noise.

Checks run

  • go test ./...: all packages pass.
  • New vm cases (mt BETWEEN …, mt NOT BETWEEN …, urls BETWEEN …) pass both before and after the change. They pin the no-match result so membership can't shift. They don't pin the absence of the log line.
  • go test -v ./vm/ -args -vv: between not implemented is printed 3 times before the change and 0 after.
  • vm/vm_test.go's msgContext map literal is already not gofmt-clean on master. I left it alone to keep the diff small.

Follow-up in lio

Bump github.com/lytics/qlbridge once this merges.

🤖 Generated with Claude Code

…left-hand type

walkTernary logged "between not implemented for type ..." every time it
evaluated BETWEEN against a map, slice or string value. Filters are
evaluated per entity, so one audience using BETWEEN on a whole
map[string]time field flooded lio's metaforarunner logs. The result is
unchanged: (nil, false), i.e. no match, the same silent outcome evalBinary
already gives a map compared with < or >.

Checks run:
- go test ./... : all packages pass
- new vm cases (map BETWEEN, map NOT BETWEEN, slice BETWEEN) pass before
  and after; they pin the no-match result, not the log line
- go test -v ./vm/ -args -vv : "between not implemented" printed 3 times
  before the change, 0 after

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@snyk-io

snyk-io Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@junichi-cstk
junichi-cstk merged commit e6ce933 into master Oct 2, 2026
5 checks passed
@junichi-cstk
junichi-cstk deleted the fix/quiet-between-unsupported-type branch October 2, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants