[pull] develop from baserow:develop#236
Merged
Merged
Conversation
* feat: add ARRAYUNIQUE() database formula function (#2326) Add array_unique() formula that removes duplicate values from lookup arrays, preserving first-occurrence order. Mirrors Airtable's ARRAYUNIQUE() — operates on true arrays from lookup fields, not plain text. Supports text, number, boolean, date, duration, URL, email, phone, rating, single select, multiple select, link row, created_on, and autonumber sub-types. Rejects file fields (different JSONB structure). * feat: enable count() and join() composability with array_unique() Add internal non-aggregate functions (array_length, array_join_values) that operate on JSONB arrays directly, and wire them into count() and join() so that count(array_unique(...)) and join(array_unique(...), sep) work. The existing many-expression paths remain unchanged. * docs: add array_unique to formula docs, mark internals as exceptions Add array_unique to formula_docs.md so the formula prompt completeness tests pass. Add array_length and array_join_values (internal delegation targets) to the formula_exceptions lists in both test files. * chore: ensure tests works also for formulas referencing different field types
* feat: add array_slice() database formula function
* fix(formula): handle NaN arguments in array_slice to prevent DB crash
Wrap start/count args with handle_arg_being_nan before truncating to
int, so expressions like tonumber('x') no longer cause
"cannot convert NaN to integer" at the PostgreSQL level.
NaN is treated as 0 for both arguments.
* feat: add first(), last() and generalized index() formula functions * fix: address PR review feedback and handle NaN index argument - Rename _BaserowIndexShortcut to BaserowIndexShortcut (drop leading _) - Remove unnecessary comments and section separators - Rename variable c to clone in JSONBArrayGetElement - Rename test to test_first_and_last_return_scalar_values, drop docstring - Remove step comments in test_index_generalized.py - Handle NaN/div-by-zero as index() argument (returns null instead of crash) * feat: update index() formula examples to include array fields
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )