Skip to content

[pull] develop from baserow:develop#236

Merged
pull[bot] merged 5 commits into
code:developfrom
baserow:develop
Apr 3, 2026
Merged

[pull] develop from baserow:develop#236
pull[bot] merged 5 commits into
code:developfrom
baserow:develop

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 3, 2026

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 : )

dimmur-brw and others added 5 commits April 3, 2026 07:04
* 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
@pull pull Bot locked and limited conversation to collaborators Apr 3, 2026
@pull pull Bot added the ⤵️ pull label Apr 3, 2026
@pull pull Bot merged commit c3958f2 into code:develop Apr 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants