Pass filter arrays natively to addok API#9
Merged
jdesboeufs merged 1 commit intomainfrom Nov 13, 2025
Merged
Conversation
- Remove filter value concatenation with '+' separator - Pass array filter values directly to addok Python API - Simplify bridge.py by removing prepare_filters function - Merge formatFilterValue into validateFilters - Filter out empty arrays from validated filters - Update documentation to clarify new behavior
There was a problem hiding this comment.
Pull Request Overview
This PR refactors filter handling to pass array values natively to the addok Python API instead of joining them with + separators, enabling more efficient multi-value filtering with OR logic.
- Removed
formatFilterValuefunction that was joining arrays with+ - Updated
validateFiltersto preserve array values as-is while filtering out empty arrays - Comprehensive test coverage for edge cases (empty arrays, single-item arrays, mixed string/array filters)
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/params.js | Removed formatFilterValue function; inlined validation logic in validateFilters to preserve arrays natively and skip empty arrays |
| test/params.js | Removed formatFilterValue tests; updated test expectations to verify arrays are preserved; added edge case tests for empty arrays and single-item arrays |
| README.md | Added note about requiring addok version with native array filter support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This PR updates the filter handling to pass array values directly to the addok Python API instead of concatenating them with
+separators.Changes
JavaScript side (
lib/params.js):+formatFilterValueintovalidateFilters(no formatting needed anymore)Python side (
lib/pyshell/bridge.py):prepare_filtersfunction (unnecessary pass-through)**filtersto addok'ssearch()andreverse()functionsBackward compatibility:
Documentation:
Example
Note: This requires addok to support native array values in filter parameters.