supabase-py icon indicating copy to clipboard operation
supabase-py copied to clipboard

setting timeout parameter does not change timeout

Open mohnish7 opened this issue 2 years ago • 18 comments
trafficstars

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. Screen Shot 2023-02-15 at 2 04 18 PM

Additional context I am running Supabase version 1.0.0

mohnish7 avatar Feb 15 '23 19:02 mohnish7

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

J0 avatar Feb 17 '23 01:02 J0

As per my comment the fix didn't seem to work for me. Does it work for others?

dschnabel avatar Feb 17 '23 09:02 dschnabel

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.

J0 avatar Feb 17 '23 14:02 J0

Hey @J0 were you able to successfully release this fix last weekend?

mohnish7 avatar Feb 21 '23 04:02 mohnish7

Hey @J0 following up again!

mohnish7 avatar Mar 03 '23 16:03 mohnish7

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

J0 avatar Mar 04 '23 09:03 J0

Hey @J0

I'm dealing with the the same problem..

rotemCyberillium avatar Mar 12 '23 09:03 rotemCyberillium

I'm also dealing with this issue

enjalot avatar Apr 25 '23 03:04 enjalot

Hey @J0 Seeing the same issue with calling Supabase from Python and seeing timeouts. Any luck with this issue?

jon-qualifai avatar May 12 '23 17:05 jon-qualifai

This might work opts = ClientOptions().replace(postgrest_client_timeout=60) supabase: Client = create_client(url, key, options=opts)

kernelguardian avatar Sep 01 '23 02:09 kernelguardian

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

J0 avatar Sep 01 '23 09:09 J0

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 avatar Sep 01 '23 15:09 kernelguardian

@kernelguardian Can you share a working code snippet? We are also running into this issue

devstein avatar Oct 05 '23 15:10 devstein

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 avatar Oct 06 '23 04:10 J0

@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

kernelguardian avatar Oct 08 '23 08:10 kernelguardian

@J0 @kernelguardian Thanks appears to be working for us now

devstein avatar Oct 08 '23 21:10 devstein

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

Satoshilab21 avatar Oct 20 '23 15:10 Satoshilab21

FYI: https://github.com/supabase-community/supabase-py/issues/487#issuecomment-1801716462

jtewright avatar Nov 08 '23 11:11 jtewright

The docs has been updated on the website to show the correct way of doing timeouts. https://supabase.com/docs/reference/python/initializing

silentworks avatar Jun 25 '24 07:06 silentworks