-
Notifications
You must be signed in to change notification settings - Fork 16k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error creating Supabase vector store when running self-query example code #10447
Comments
🤖 Hello, Thank you for providing such a detailed report of the issue you're experiencing. It seems like the problem is occurring when the Supabase client is trying to parse an empty response body as JSON, which is causing the The The error you're encountering seems to be happening when the As for your question about whether there are extra headers that should be added to the Supabase client to tell it to return a response body, I'm not aware of any such headers. The Supabase client should automatically return a response body when the I would suggest a few things to troubleshoot this issue:
client = supabase.create_client(SUPABASE_URL, SUPABASE_ANON_KEY)
result = client.from_("your_table_name").upsert({"id": "test_id", "content": "test_content", "embedding": [0.0, 0.0, 0.0], "metadata": {"test": "metadata"}}).execute()
print(result.data) Please replace If the I hope this helps! Please let me know if you have any other questions or if there's anything else I can do to assist you. SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
I think I found the issue, it looks like it's specific to python 3.11 and the way it treats enums. When downgrading to python 3.8 the issue goes away. I added a debug statement to this line:
Python 3.8 output:
Python 3.11 output:
With python 3.11, the |
It was already fixed in postgrext in supabase/postgrest-py#169, but since this example code pins the version to supabase 1.0.0 then postgrext version Any reason why this only works with the older supabase 1.0.0 package? If it can't be upgraded to uptake the fix, it's worth adding a warning to the docs to only use python 3.10 or earlier. I would volunteer to send a quick PR if it would help. |
@tleyden Nice work debugging this one. |
@tleyden the error that required
Do you mind giving the new notebook a go and let me know if that solves everything? |
Thanks @gregnr, I think this should fix it! I’ll proactively close this out but will reopen if I come across any more issues |
System Info
Langchain: 0.0.285
Platform: OSX Ventura (apple silicon)
Python version: 3.11
Who can help?
@gregnr since it looks like you added the Supabase example code
Information
Related Components
Reproduction
On the step to:
it fails with error
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
:Stacktrace
It appears that Supabase is returning a 201 response code, with an empty body in the response. Then the posgrest library is trying to parse the json with
data = request_response.json()
, but that fails due to the empty body.Are there some extra headers that should be added to the supabase client to tell it return a response body?
Expected behavior
No error when invoking
SupabaseVectorStore.from_documents()
The text was updated successfully, but these errors were encountered: