keosariel / supabase-client

A supabase client for python
https://keosariel.github.io/2021/08/08/supabase-client-python/
MIT License
12 stars 4 forks source link

gt, gte, lt and lte functions do not take dates as inputs #3

Closed eliot-tabet closed 2 years ago

eliot-tabet commented 2 years ago

I tried running these methods to filter a table between a date range. I tried using the date in string format "yyyy-mm-dd" as well as in datetime format.

So I tried:

sd = "2022-10-01" supabase.table("table").gte("date", sd).query()

as well as sd = "2022-10-01" sd = datetime.strptime(sd, '%Y-%m-%d') supabase.table("table").gte("date", sd).query()

Both returned:

UnexpectedValueTypeError: Expected type int for: val

Maybe I should convert this date into an int, but this seems irrational to me, since in 5 years of exp I never had to do that even though I am not a DataBase/SQL expert ? If so, how ?

keosariel commented 2 years ago

Hi @eliot-tabet,

The date format wasn't considered earlier, and now this issue has been fixed!