-
-
Couldn't load subscription status.
- Fork 375
Description
Describe the bug
Hello
I just updated my application to supabase-py version 2.22.1 and now I get an error when simply running a db query.
I'm using an AsyncClient and this error is NOT related to .execute(), it occurs on the .table() function.
UPDATE: The problem is not from the code, it's because all new package of supabase since version 2.19.0 does NOT supply version restriction on dependencies:
$ pipdeptree -p supabase -d 1
supabase==2.22.1
├── realtime [required: Any, installed: 2.7.0]
├── supabase_functions [required: Any, installed: 0.10.1]
├── storage3 [required: Any, installed: 0.12.1]
├── supabase_auth [required: Any, installed: 2.12.3]
├── postgrest [required: Any, installed: 1.1.1]
└── httpx [required: >=0.26,<0.29, installed: 0.28.1]
So any old env with postgrest installed in version 0.19.3, will stay in that version after upgrading supabase to 2.22.1.
Reproduction
- Create a venv with
supabaseversion2.13.0 - Update your venv with
supabaseversion2.22.1 - Create a supabase AsyncClient with the function
create_async_client() - Then run
supabase.table("test")and I got the following error and traceback:
TypeError: AsyncPostgrestClient.__init__() got an unexpected keyword argument 'http_client'
│ /app/.venv/lib/python3.13/site-packages/supabase/_async/client.py:124 in table │
│ │
│ 121 │ │ this is a reserved keyword, so we have elected to use the name `table`. │
│ 122 │ │ Alternatively you can use the `.from_()` method. │
│ 123 │ │ """ │
│ ❱ 124 │ │ return self.from_(table_name) │
│ 125 │ │
│ 126 │ def schema(self, schema: str): │
│ 127 │ │ """Select a schema to query or perform an function (rpc) call. │
│ │
│ ╭────────────────────────────────── locals ──────────────────────────────────╮ │
│ │ self = <supabase._async.client.AsyncClient object at 0x7fa7092756a0> │ │
│ │ table_name = 'test' │ │
│ ╰────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /app/.venv/lib/python3.13/site-packages/supabase/_async/client.py:138 in from_ │
│ │
│ 135 │ │ │
│ 136 │ │ See the `table` method. │
│ 137 │ │ """ │
│ ❱ 138 │ │ return self.postgrest.from_(table_name) │
│ 139 │ │
│ 140 │ def rpc( │
│ 141 │ │ self, │
│ │
│ ╭────────────────────────────────── locals ──────────────────────────────────╮ │
│ │ self = <supabase._async.client.AsyncClient object at 0x7fa7092756a0> │ │
│ │ table_name = 'test' │ │
│ ╰────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /app/.venv/lib/python3.13/site-packages/supabase/_async/client.py:173 in postgrest │
│ │
│ 170 │ @property │
│ 171 │ def postgrest(self): │
│ 172 │ │ if self._postgrest is None: │
│ ❱ 173 │ │ │ self._postgrest = self._init_postgrest_client( │
│ 174 │ │ │ │ rest_url=self.rest_url, │
│ 175 │ │ │ │ headers=self.options.headers, │
│ 176 │ │ │ │ schema=self.options.schema, │
│ │
│ ╭─────────────────────────────── locals ───────────────────────────────╮ │
│ │ self = <supabase._async.client.AsyncClient object at 0x7fa7092756a0> │ │
│ ╰──────────────────────────────────────────────────────────────────────╯ │
│ │
│ /app/.venv/lib/python3.13/site-packages/supabase/_async/client.py:304 in _init_postgrest_client │
│ │
│ 301 │ │ │ │ "http_client": None, │
│ 302 │ │ │ } │
│ 303 │ │ │
│ ❱ 304 │ │ return AsyncPostgrestClient( │
│ 305 │ │ │ rest_url, │
│ 306 │ │ │ headers=headers, │
│ 307 │ │ │ schema=schema, │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ headers = { │ │
│ │ │ 'X-Client-Info': 'supabase-py/2.22.1', │ │
│ │ │ 'apiKey': '<redacted>' │ │
│ │ │ 'Authorization': 'Bearer <redacted>' │ │
│ │ } │ │
│ │ http_client = None │ │
│ │ kwargs = {'timeout': 10, 'verify': True, 'proxy': None, 'http_client': None} │ │
│ │ proxy = None │ │
│ │ rest_url = 'https://<redacted>.supabase.co/rest/v1' │ │
│ │ schema = 'public' │ │
│ │ timeout = 10 │ │
│ │ verify = True │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯Thanks for the help!
Steps to reproduce
No response
Library affected
supabase-py
Library version
2.22.1
Python version
Python 3.13.7