pythonsupabasepostgrest

supabase python - i'm trying to update an entry in a supabase table but postgrest returns 'Failed to parse [("id","Filters.EQ.1")]'


as the title says, im using the supabase python library for a small project which requires me to update a table regularly.

i've set up this small test to construct an update function.

updatedtime = str(datetime.now()+timedelta(seconds=10))
    
update = sb.table("schedule").update({"scheduled_time": updatedtime}).eq("id", 1).execute()

if update:
    print("updated schedule!")
else:
    print("L")

running this returns: postgrest.exceptions.APIError: {'code': 'PGRST104', 'details': 'Failed to parse [("id","Filters.EQ.1")]', 'hint': None, 'message': 'Unexpected param or filter missing operator'}

i've learned this from a youtube tutorial, and as far as i know i've followed it pretty well.

does anyone know what's going on?

if anyone needs more context let me know.


Solution

  • i solved it. the postgrest python library defined the filters class as an enum (Lib/site-packages/postgrest/types.py), which returned the string "Filters.EQ" rather than just "eq", which is what produced the error. i turned it into a regular object and the only thing the request returns now is a 204 status code.