Repository navigation
fix(functions): port main's changes to v3 - #1794
Merged
Merged
Conversation
This was referenced Oct 20, 2026
Contributor
|
The following capabilities are marked
The following capabilities are marked
These may have been renamed, removed, or never registered. Please update the capability matrix. |
grdsdev
reviewed
Oct 20, 2026
grdsdev
reviewed
Oct 20, 2026
grdsdev
reviewed
Oct 20, 2026
grdsdev
reviewed
Oct 20, 2026
grdsdev
reviewed
Oct 20, 2026
grdsdev
reviewed
Oct 20, 2026
grdsdev
reviewed
Oct 20, 2026
grdsdev
reviewed
Oct 20, 2026
grdsdev
reviewed
Oct 20, 2026
spydon
force-pushed
the
v3-sync/04-functions
branch
from
October 21, 2026 07:13
ff5d594 to
efecdf7
Compare
spydon
force-pushed
the
v3-sync/04-functions
branch
from
October 21, 2026 07:46
efecdf7 to
16a9a94
Compare
grdsdev
approved these changes
Oct 21, 2026
spydon
force-pushed
the
v3-sync/04-functions
branch
2 times, most recently
from
October 22, 2026 08:01
6baf37c to
ca8ac2f
Compare
spydon
force-pushed
the
v3-sync/04-functions
branch
from
October 26, 2026 13:45
ca8ac2f to
5af0cd3
Compare
spydon
force-pushed
the
v3-sync/04-functions
branch
from
October 26, 2026 14:08
5af0cd3 to
49be279
Compare
spydon
force-pushed
the
v3-sync/04-functions
branch
from
October 27, 2026 16:26
49be279 to
63b30d9
Compare
spydon
force-pushed
the
v3-sync/04-functions
branch
from
October 27, 2026 16:48
63b30d9 to
b60171c
Compare
…#1638) Co-authored-by: Leonardo Santiago <[email protected]> (cherry picked from commit f294058)
… calls (#1536) v3 already builds per-call headers from immutable Headers, so only the tests are ported. Co-authored-by: Leonardo Santiago <[email protected]> (cherry picked from commit 655d4c2)
Body requests appended a second Content-Type value when the caller already set one, and Response.is_success accepted status 300.
invoke() now uses the shared supabase_utils request types, sends lists as JSON, raises TypeError for unsupported bodies, and documents its parameters. Error messages fall back to the message key and then the raw body, and structured errors are rendered as JSON.
…ient Content-Type Body requests now keep a Content-Type only when the request itself sets one, so a client-wide Content-Type no longer mislabels JSON bodies in auth, postgrest and storage. Functions still applies a client-level Content-Type, as on main. invoke() accepts a region string, as on main, and region overrides an x-region header instead of appending to it.
spydon
force-pushed
the
v3-sync/04-functions
branch
from
October 27, 2026 16:55
b60171c to
3c3de10
Compare
spydon
added a commit
that referenced
this pull request
Nov 12, 2026
) Step 2 of [SDK-2765](https://linear.app/supabase/issue/SDK-2765) ([SDK-2985](https://linear.app/supabase/issue/SDK-2985)): the operators that step 1 left out and the orderings, on the column expressions and the filter tree of #2041. A port of supabase-flutter #1794 with the typed ranges of SDK-1755. ## What - Text operators with `self: ColumnExpression[Row, str]`: `like`, `ilike`, `match_regex`, `imatch_regex`, `like_all_of`, `like_any_of`, `ilike_all_of`, `ilike_any_of`. The quantified forms take an iterable of patterns and send it as the array literal `{a,b}`, with each member escaped as that literal requires, where the string builder wraps one comma-separated string in braces as given. One string in place of the iterable raises `TypeError`, as `in_()` does. - `contains`, `contained_by` and `overlaps` as overloads on the `self` type, since the column type decides the shape of the operand: an array column (`list[Element]`) takes an iterable of elements and sends `{a,NULL}` through `_sanitize_array_param`; a range column (`Range[Bound]`) takes a `Range[Bound]` and sends `[2,25)`, and `contains()` also takes one `Bound` for `cs.21`; a JSON column (`JsonValue`) takes a mapping and sends compact JSON. A JSON array or scalar operand has no typed form and goes through `raw()`, as the docstring says. jsonb has no `&&`, so `overlaps` has no JSON overload. The range operators `range_lt`, `range_gt`, `range_gte`, `range_lte` and `range_adjacent` exist on range columns only. - `Range[Bound]`, a frozen dataclass shaped like psycopg's: `Range(2, 25)` is `[2,25)`, `bounds` picks the other three forms, `None` is an unbounded side, and `str()` is the literal Postgres reads. Bounds render as filter values and are quoted when they hold range syntax or are empty. The parent issue leaves ranges as `str` or a typed range open; the ticket's acceptance criterion, that a range operator on a non-range column is a type error, needs a type that a text column does not have, so `Range` it is. The generator keeps mapping ranges to `str` until step 10. - `Ordering[Row]`, an interface with `order_key`, `asc()`, `desc()`, `nulls_first()` and `nulls_last()`. A `ColumnExpression` is an `Ordering` with no direction, so `order(Books.title)` will send `order=title`, and each call returns a value holding only what was asked for: `title.desc`, `published_on.nullsfirst`, `published_on.desc.nullslast`. The string builder's `order()` always sends a direction. - `FilterOperator` gains the tokens of the new operators, and `Comparison.value` carries the operand as given: a tuple for the array operators, a `Range` for the range operators, a mapping for JSON. ## Tests - `test_filter_operators.py` ports the Dart operator tests: wire operators, array literal escaping, `NULL` members, range and JSON operands quoted inside a group, negation, `Comparison` exposure, and `TestEqualsTheStringBuilder`, which asserts for every new operator, operand and negation that the query parameters equal what `BaseFilterRequestBuilder` produces. Two comparisons are modulo whitespace, since the string builder's `contains()` encodes JSON with a space after each colon where its `eq()` is compact, and its `like_all_of()` does not quote members. - `test_ordering.py` covers the order keys, chaining in either order, replacement, value semantics and equality with `order()` of the string builder for every `desc` and `nullsfirst` combination. `test_range.py` covers the literal forms, unbounded sides, bound rendering and quoting, and the `bounds` validation. - `tests/typecheck/operators.py` and `orderings.py` are run by `test_typecheck.py` under mypy, pyright and pyrefly: `like()` on an `int` and a `list` column, an array operator on an `int` and a `str` column, a wrong element type, a JSON array or scalar operand, `overlaps()` on a JSON column, a range operator on a `str`, `int` and `list` column, a range with the wrong bound type, a range literal string, an invalid `bounds` form, and an ordering from another table are each an error on exactly the marked lines, while correct use type-checks without ignores. A mapping passed to an array column cannot be rejected statically, since a `dict` is an `Iterable` of its keys. - The `builder` and `select_builder` fixtures of `test_filter.py` move to a `conftest.py` so the new tests share them. ## Compliance The new symbols are listed under the top-level `supporting_symbols` of `sdk-compliance.yaml`, as in step 1; the feature status changes in step 8. Linear: SDK-2985
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.
Cherry-picks main's functions commits onto v3, ported to v3's single
client.py. Where v3 already had the behavior, only the tests are ported, and the commit message says so.verifykeyword increate_client): v3's clients have noverifyparameter.Review fixes
Response.is_successno longer accepts 300. Functions now uses the shared request types, so_BodyRequestis gone.invoke()sends lists as JSON, raisesTypeErrorfor unsupported bodies, and documents its parameters.messagekey and then the raw body, and structured errors are rendered as JSON.invoke()accepts a region string, as on main, andregionoverrides anx-regionheader instead of appending to it.Commits
Stack
This replaces #1789: main's changes since 6f522d3 are cherry-picked onto v3 one package at a time, so each part can be reviewed on its own. Merge from the bottom up.