Skip to content

Please provide more info on return types from execute #115

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

Closed
songololo opened this issue Jan 6, 2022 · 5 comments
Closed

Please provide more info on return types from execute #115

songololo opened this issue Jan 6, 2022 · 5 comments

Comments

@songololo
Copy link

The return types from execute currently require trial and error to unpack. Would it be possible to add more information in the README.md explaining what the potential return types are and what they mean?

e.g. the returned value seems to have changed from a prior version of postgrest-py: it now returns a tuple of data and a None value. But it isn't clear what this None value represents and how to handle potential response errors on the return types?

@dreinon
Copy link
Contributor

dreinon commented Jan 6, 2022

Hi! Thanks for reporting. We have an open PR to solve this, which only needs a few tests to be written

@dreinon
Copy link
Contributor

dreinon commented Jan 6, 2022

Btw, that None value is intended to be the count value if you ask for it in the query.

@dannmate
Copy link

dannmate commented Jan 7, 2022

I am finding the return types are different also from selecting data, to inserting/updating, looking forward to the PR :)

@dreinon
Copy link
Contributor

dreinon commented Feb 4, 2022

Hi! This issue should be solved with the new version of postgrest-py and supabase-py, we use a pydantic model now to represent a Response, which has two properties, data and count, and you'll get an APIError raised if the call returns an error 🙂.

Closing this issue, but feel free to reopen or comment here if you have any more concerns, thanks!

@dreinon dreinon closed this as completed Feb 4, 2022
@dreinon dreinon moved this to Done in Supabase Python Feb 4, 2022
@Filsommer
Copy link

In which supabase version was this implemented? I still get type Any pretty much everywhere when executing supabase queries in python. Using supabase==1.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants