fix: auto-convert boolean integers to strings in tag conditions#7682
Closed
fix: auto-convert boolean integers to strings in tag conditions#7682
Conversation
added 5 commits
January 28, 2026 12:04
Boolean search filters (like error.main_thread) are parsed with integer values (0 or 1) but can be classified as tags when not in entity schema. Since tags are always strings in ClickHouse, we now auto-convert integer literals 0 and 1 to '0' and '1' in tag conditions. This allows queries like 'error.main_thread:1' to work correctly even when the field is treated as a tag. Fixes SNUBA-9VC
Verify that the TagConditionValidator fix works correctly with the search_issues entity for real-world scenarios like error.main_thread and stack.in_app. Refs SNUBA-9VC
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.
dont review, this is for an experiment
Superpowers Generate
Summary
Fixes validation error when boolean fields (0/1) are used in tag conditions by auto-converting integer literals to strings in
TagConditionValidator.Problem
Issue SNUBA-9VC reported validation failures like:
This occurs when boolean search filters (like
error.main_thread:1) are:Since tags are always strings in ClickHouse, the
TagConditionValidatorrejected these integer values.Solution
Modified
TagConditionValidatorto automatically convert integer literals0and1to their string equivalents"0"and"1"when they appear in tag conditions. This handles both:tags[error.main_thread] = 1→tags[error.main_thread] = "1"tags[field] IN [0, 1]→tags[field] IN ["0", "1"]Non-boolean integers (like 419) still fail validation as expected.
Testing
search_issuesentityFixes SNUBA-9VC
🤖 Generated with Claude Code