Skip to content
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

eq adding Filters.EQ istead of eq #190

Closed
anoninthekop opened this issue Nov 17, 2022 · 4 comments
Closed

eq adding Filters.EQ istead of eq #190

anoninthekop opened this issue Nov 17, 2022 · 4 comments

Comments

@anoninthekop
Copy link

anoninthekop commented Nov 17, 2022

Describe the bug
On python 3.11 using eq is adding column_name=Filters.EQ to the query string instead of column_name=eq causing the error postgrest.exceptions.APIError: {'code': 'PGRST104', 'details': 'Failed to parse [("column_name","Filters.EQ.1")]', 'hint': None, 'message':
'Unexpected param or filter missing operator'}

To Reproduce
Steps to reproduce the behavior:

  1. supabase.table("table1").select("column1").eq("column2", 1).order("id", desc=True ).limit(1).single().execute()
  2. resulting query is database/table1?select=column1&column2=Filters.EQ.1&order=id.desc&limit=1 | python-httpx/0.23.0
  3. See error postgrest.exceptions.APIError: {'code': 'PGRST104', 'details': 'Failed to parse [("column2","Filters.EQ.1")]', 'hint': None, 'message':
    'Unexpected param or filter missing operator'}

Expected behavior
query should should be database/table1?select=column1&column2=eq.1&order=id.desc&limit=1 | python-httpx/0.23.0

@tcrch
Copy link

tcrch commented Nov 19, 2022

is there anyway around this?

@SinaKhalili
Copy link

Was struggling with this as well.
Since this is from a dependency, postgrest-py, I would say probably nothing you can do, at least nothing as easy as just downgrading to 3.10.
I've opened an issue there, so once that fix gets made I assume it'll be updated here as well.

@espinozajp
Copy link

I could solve using the filter method instead eq.

So if you try with supabase.table("table1").select("column1").filter("column2", "eq", 1).order("id", desc=True ).limit(1).single().execute() should work.

@J0 J0 transferred this issue from supabase/supabase-py Jan 23, 2023
@J0
Copy link
Contributor

J0 commented Feb 12, 2023

Hey!

Just tested @espinozajp 's query with Python3.11 and it seems to work - going to close now but feel free to report back if there are issues.

Thanks!

@J0 J0 closed this as completed Feb 12, 2023
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

5 participants