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

supabase / supabase-py / 41641867822 / 6
98%
main: 98%

Build:
DEFAULT BRANCH: main
Ran 03 Nov 2026 01:13PM UTC
Files 61
Run time 1s
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

03 Nov 2026 01:09PM UTC coverage: 96.364%. Remained the same
41641867822.6

push

github

web-flow
fix(supabase): reject non-string url and key in create_client (#1926)

## What

`Client.__init__` (async source and generated sync copy) now checks that
`supabase_url` and `supabase_key` are strings before the existing
checks, and raises `SupabaseException` with a clear message
(`supabase_url must be a string, got int`) otherwise.

Before:
- `create_client(139, "key")` raised a raw `TypeError` from `re.match`.
- `create_client("https://x.supabase.co", 139)` succeeded, and the
integer key only failed later, at request time, from inside the headers.

`None` and empty values still raise the existing `... is required`
messages, and invalid URLs still raise `Invalid URL`. Both
`create_client` and `create_async_client` go through `__init__`, so they
are covered.

## Tests

`test_incorrect_values_dont_instantiate_client` could never fail: it
swallowed the expected exception and was also marked as a non-strict
`xfail`, producing 86 unexpected passes per run. It is replaced by a
parametrized test over invalid URLs (`""`, `None`, `"not-a-url"`,
`"ftp://..."`, `"https://"`, `{}`, `[]`, `139`) and invalid keys (`""`,
`None`, `{}`, `[]`, `139`) that asserts `SupabaseException` with
`pytest.raises` and no `xfail`. A new test checks that a valid URL and
key still create a client. The `139` cases fail without the fix.

`pytest tests`: 81 passed, 0 xpassed. `mypy`: clean.

Fixes SDK-2674

## Self-review changes

A `/code-review` pass led to these changes:
- Validation now runs one field at a time through a `_validate_str_arg`
helper (type check, then required check), so with two bad arguments the
error is about the first one, for example `create_client(None, 139)`
reports `supabase_url is required`.
- The parametrized test asserts the exact error message, so the `{}` and
`[]` cases now prove they hit the new type check rather than the old
falsy check. Cases with both arguments invalid were added.

Not changed, because they are out of scope for this ticket: rejecting
w... (continued)

5088 of 5280 relevant lines covered (96.36%)

0.96 hits per line

Source Files on job run-ubuntu-latest-3.14-auth - 41641867822.6
  • Tree
  • List 61
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 41641867822
  • 030cbc9c on github
  • Prev Job for on main (#41641760894.27)
  • Next Job for on main (#41641937400.26)
  • 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