supabase-py
supabase-py copied to clipboard
setting timeout parameter does not change timeout
Describe the bug
Despite setting a timeout parameter in clientOptions, the query still times out in 5 seconds
To Reproduce
from supabase import create_client, Client
from supabase.lib.client_options import ClientOptions
client_options = ClientOptions(timeout=60)
supabase = create_client(SUPABASE_URL, SUPABASE_ANON_KEY, options=client_options)
Expected behavior The function should now time out after 60 seconds
Screenshots
If applicable, add screenshots to help explain your problem.

Additional context I am running Supabase version 1.0.0
Hey @mohnish7,
The timeout param currently isn't being passed through - a fix was made but hasn't been published. I'll release it sometime this weekend - feel free to bump if you need it sooner
As per my comment the fix didn't seem to work for me. Does it work for others?
Hey @dschnabel,
Just seeing this- it’s currently being passed to the postgrest client which may be why the fix doesn’t work out on sign up calls. I’ll see if I can pass it into the Auth client as well.
Hey @J0 were you able to successfully release this fix last weekend?
Hey @J0 following up again!
Hey @mohnish7,
Thanks for the tag, so sorry didn't realize I missed this - wasn't able to get around to it but it's on my todo list for this week
Hey @J0
I'm dealing with the the same problem..
I'm also dealing with this issue
Hey @J0 Seeing the same issue with calling Supabase from Python and seeing timeouts. Any luck with this issue?
This might work
opts = ClientOptions().replace(postgrest_client_timeout=60) supabase: Client = create_client(url, key, options=opts)
Hey team,
Apologies just setting this again. Thanks for bumping - I'll re-look into the issue after work. Can I confirm the issue is on the postgrest-py client for all of y'all
Hey @J0 I am not sure. The feature seems to be working fine for setting client options, maybe update the documentation if it's the intended way of setting client options. Thanks
@kernelguardian Can you share a working code snippet? We are also running into this issue
Hey all,
We've updated the documentation around options - https://supabase.com/docs/reference/python/initializing?example=with-timeout-option
It should work now. Do y'all mind trying again and then letting us know if there are still issues?
Thanks
@J0 haven't touched that project in a while, will update once I get a chance. @devstein check the previous comment -> https://github.com/supabase-community/supabase-py/issues/376#issuecomment-1702061376
@J0 @kernelguardian Thanks appears to be working for us now
Does anyone know if this error relates to this?
APIError: {'code': '57014', 'details': None, 'hint': None, 'message': 'canceling statement due to statement timeout'}
When I apply the Client Options the "read timeout error" no longer occurs, but I now receive the above error.
I am executing the following line in python, where col1 is just a long column of numbers (~5.5M)
supabase.table('data').select('col1').order('col1', desc=True).limit(1).execute()
I am looking to get the max value of the column. I am running Supabase version 1.2.0
FYI: https://github.com/supabase-community/supabase-py/issues/487#issuecomment-1801716462
The docs has been updated on the website to show the correct way of doing timeouts. https://supabase.com/docs/reference/python/initializing