• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / supabase-py / 43459907073
98%

Build:
DEFAULT BRANCH: main
Ran 13 Nov 2026 04:10PM UTC
Jobs 35
Files 149
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Nov 2026 04:09PM UTC coverage: 97.952% (+0.02%) from 97.929%
43459907073

push

github

web-flow
fix(postgrest)!: parse responses with json.loads and return scalar RPC results (#2049)

## What

Postgrest responses are now parsed with `json.loads` plus a shape check
instead of a pydantic `TypeAdapter`, and `rpc().execute()` returns
whatever JSON value the function produced.

## Why

- The `TypeAdapter(list[dict[str, JSON]])` parse was slow. On 10,000
rows it took 21.2 ms against 3.7 ms for `json.loads` with the shape
check. v2 made the same switch in #1571.
- An RPC returning a scalar (body `1` or `"text"`) or a single row (body
`{...}`) failed validation and raised `APIError` with code `"200"`, even
though the call succeeded.

## Changes

- New private module `postgrest/_parsing.py` with `parse_json`,
`parse_rows` and `parse_object`. They decode with `json.loads` and raise
`InvalidResponseBodyError` when the body is not JSON (including bodies
nested too deeply for `json.loads`) or not in the expected shape.
- `APIResponse`, `SingleAPIResponse` and the table executor use these
helpers. Callers catch `InvalidResponseBodyError` instead of pydantic's
`ValidationError` and turn it into `APIError` as before. Other errors,
such as a malformed `Content-Range`, are not swallowed.
- New `RPCResponse` dataclass with `data: JSON` and `count`.
`RPCFilterRequestBuilder.execute()` returns it instead of `APIResponse`.
An empty body gives `data=None`, and `csv()` on an RPC gives the text,
where it used to fail on JSON parsing.
- `RPCResponse` is exported from `postgrest`, exported from `supabase`
as `PostgrestRPCResponse`, and registered in `sdk-compliance.yaml` under
`database.query.rpc`.
- `MIGRATION.md` documents the `RPCResponse` change.
- The test schema gets three new functions: `count_stored_countries`
(bigint), `country_iso` (text) and `stored_country` (a single row).

## Behavior change

`rpc(...).execute()` now returns `RPCResponse` rather than
`APIResponse`. At runtime `data` is the same for set returning
functions. For type checkers, `data` is `JSON` ... (continued)

15738 of 16067 relevant lines covered (97.95%)

5.05 hits per line

Coverage Regressions

Lines Coverage ∆ File
16
96.79
0.49% src/postgrest/request_builder.py
6
97.78
0.01% src/supabase/client.py
6
97.13
-0.01% src/postgrest/table_executor.py
Jobs
ID Job ID Ran Files Coverage
1 auth-py3.12-highest - 43459907073.1 13 Nov 2026 04:11PM UTC 43
96.77
GitHub Action Run
2 functions-py3.12-lowest-direct - 43459907073.2 13 Nov 2026 04:10PM UTC 14
99.12
GitHub Action Run
3 functions-py3.14-highest - 43459907073.3 13 Nov 2026 04:10PM UTC 14
99.12
GitHub Action Run
4 realtime-py3.12-highest - 43459907073.4 13 Nov 2026 04:11PM UTC 10
97.39
GitHub Action Run
5 postgrest-py3.14-highest - 43459907073.5 13 Nov 2026 04:11PM UTC 45
98.92
GitHub Action Run
6 storage-py3.14-highest - 43459907073.6 13 Nov 2026 04:11PM UTC 24
95.99
GitHub Action Run
7 realtime-py3.12-lowest-direct - 43459907073.7 13 Nov 2026 04:11PM UTC 10
97.39
GitHub Action Run
8 storage-py3.13-highest - 43459907073.8 13 Nov 2026 04:11PM UTC 24
95.99
GitHub Action Run
9 utils-py3.12-lowest-direct - 43459907073.9 13 Nov 2026 04:10PM UTC 24
99.67
GitHub Action Run
10 supabase-py3.15-highest - 43459907073.10 13 Nov 2026 04:11PM UTC 20
99.32
GitHub Action Run
11 functions-py3.13-highest - 43459907073.11 13 Nov 2026 04:10PM UTC 14
99.12
GitHub Action Run
12 auth-py3.12-lowest-direct - 43459907073.12 13 Nov 2026 04:11PM UTC 43
96.77
GitHub Action Run
13 postgrest-py3.13-highest - 43459907073.13 13 Nov 2026 04:11PM UTC 45
98.93
GitHub Action Run
14 auth-py3.15-highest - 43459907073.14 13 Nov 2026 04:11PM UTC 43
96.77
GitHub Action Run
15 functions-py3.12-highest - 43459907073.15 13 Nov 2026 04:10PM UTC 14
99.12
GitHub Action Run
16 storage-py3.12-lowest-direct - 43459907073.16 13 Nov 2026 04:11PM UTC 24
95.99
GitHub Action Run
17 realtime-py3.15-highest - 43459907073.17 13 Nov 2026 04:11PM UTC 10
97.27
GitHub Action Run
18 supabase-py3.12-lowest-direct - 43459907073.18 13 Nov 2026 04:10PM UTC 20
99.32
GitHub Action Run
19 supabase-py3.13-highest - 43459907073.19 13 Nov 2026 04:10PM UTC 20
99.32
GitHub Action Run
20 realtime-py3.13-highest - 43459907073.20 13 Nov 2026 04:11PM UTC 10
97.51
GitHub Action Run
21 supabase-py3.14-highest - 43459907073.21 13 Nov 2026 04:10PM UTC 20
99.32
GitHub Action Run
22 storage-py3.15-highest - 43459907073.22 13 Nov 2026 04:12PM UTC 24
95.99
GitHub Action Run
23 auth-py3.14-highest - 43459907073.23 13 Nov 2026 04:13PM UTC 43
96.77
GitHub Action Run
24 utils-py3.13-highest - 43459907073.24 13 Nov 2026 04:10PM UTC 24
99.67
GitHub Action Run
25 auth-py3.13-highest - 43459907073.25 13 Nov 2026 04:11PM UTC 43
96.77
GitHub Action Run
26 storage-py3.12-highest - 43459907073.26 13 Nov 2026 04:11PM UTC 24
95.99
GitHub Action Run
27 utils-py3.15-highest - 43459907073.27 13 Nov 2026 04:10PM UTC 24
99.67
GitHub Action Run
28 realtime-py3.14-highest - 43459907073.28 13 Nov 2026 04:11PM UTC 10
97.27
GitHub Action Run
29 functions-py3.15-highest - 43459907073.29 13 Nov 2026 04:10PM UTC 14
99.12
GitHub Action Run
30 postgrest-py3.12-highest - 43459907073.30 13 Nov 2026 04:11PM UTC 45
98.93
GitHub Action Run
31 utils-py3.14-highest - 43459907073.31 13 Nov 2026 04:10PM UTC 24
99.67
GitHub Action Run
32 postgrest-py3.12-lowest-direct - 43459907073.32 13 Nov 2026 04:12PM UTC 45
98.93
GitHub Action Run
33 postgrest-py3.15-highest - 43459907073.33 13 Nov 2026 04:12PM UTC 45
98.92
GitHub Action Run
34 utils-py3.12-highest - 43459907073.34 13 Nov 2026 04:10PM UTC 24
99.67
GitHub Action Run
35 supabase-py3.12-highest - 43459907073.35 13 Nov 2026 04:10PM UTC 20
99.32
GitHub Action Run
Source Files on build 43459907073
  • Tree
  • List 149
  • Changed 9
  • Source Changed 0
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #43459907073
  • d5ead1f5 on github
  • Prev Build on main (#43437175470)
  • Next Build on main (#43462763699)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc