fix(query): support select_keys in regex rules#605
Conversation
Greptile SummaryThis PR adds a
Confidence Score: 5/5Safe to merge; the feature logic is correct and the existing test suite covers all new code paths. The select_keys parsing, dispatch, and empty-list guard all work correctly. The one notable rough edge is that an empty list provided at the query layer produces a misleading "Failed to compile regex string" error instead of InvalidFunctionParameters, but this does not affect normal usage or data correctness. aw-query/src/datatype.rs — the empty select_keys path leaks a regex-compile error type/message rather than an InvalidFunctionParameters one. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["TryFrom for Rule"] --> B{select_keys present?}
B -- None --> E[select_keys = None]
B -- "Some, not a List" --> F["Err: InvalidFunctionParameters 'not a list'"]
B -- "Some(List)" --> C{all items strings?}
C -- No --> G["Err: InvalidFunctionParameters 'must contain only strings'"]
C -- Yes --> D{list empty?}
D -- "Yes (current)" --> H["fancy_regex::Error wrapped as RegexCompileError"]
D -- "Yes (suggested)" --> I["Err: InvalidFunctionParameters 'must not be empty'"]
D -- No --> E
E --> J["RegexRule::new()"]
J --> K["matches(): Some keys or all values"]
Reviews (3): Last reviewed commit: "fix(classify): validate empty select_key..." | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #605 +/- ##
==========================================
+ Coverage 70.81% 76.71% +5.90%
==========================================
Files 51 61 +10
Lines 2916 4858 +1942
==========================================
+ Hits 2065 3727 +1662
- Misses 851 1131 +280 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Addresses Greptile feedback: - Return error on empty select_keys list instead of silently producing a never-matching rule - Replace .unwrap() on regex.is_match() with .unwrap_or(false) to avoid panicking on match-time regex errors - Add test covering the empty list rejection
e0441b0 to
a21e9ee
Compare
|
Addressed the two Greptile findings:
Verification: |
|
CI is green and the two Greptile review threads are resolved. I tried to merge this with a squash commit from this session, but the current GitHub token does not have permission to merge PRs in |
Summary
select_keyson regex classification rulesCloses #604
Testing