https://supabase.com/ logo
Join Discord
Powered by
# python
  • j

    J0

    10/13/2021, 4:50 AM
    ah no that was on gotrue-py
  • d

    Deleted User

    10/13/2021, 4:50 AM
    Yeah, I want to collaborate with async support for gotrue, but, first, I want to implement the types with dataclasses
  • d

    Deleted User

    10/13/2021, 4:58 AM
    @User does postgrest-py only support async? I think that the idea that httpx follows of implementing both sync and async support is ideal, because there are still many contexts (for example Flask) where sync would be useful.
  • j

    J0

    10/13/2021, 5:02 AM
    Last I checked, postgrest-py only support async. Agree that both sync/async can be useful in different scenarios and that it would be nice to have the optionality to choose between the two
  • a

    anand

    10/13/2021, 7:33 AM
    Copy code
    [INFO] Installing environment for https://github.com/ambv/black.
    [INFO] Once installed this environment will be reused.
    [INFO] This may take a few minutes...
    An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\anand\\OneDrive\\Documents\\Projects\\supabase-py\\.venv\\Scripts\\python.exe', '-mvirtualenv', 'C:\\Users\\anand\\.cache\\pre-commit\\reponw2hnifn\\py_env-python3.7', '-p', 'python3.7')
    return code: 1
    expected return code: 0
    stdout:
        RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.7'
    the language version pin in the pre-commit config is a little annoying 😦
  • a

    anand

    10/13/2021, 7:33 AM
    (the error occurs because of )
  • a

    anand

    10/13/2021, 7:54 AM
    also, in the storage_bucket_api file, I see that we're excepting errors and just printing it out, which doesn't feel very pythonic to me
  • a

    anand

    10/13/2021, 7:55 AM
    I'd suggest wrapping them into custom exceptions (BucketNotFound, for example) that inherit from a base
    SupabaseError
    and then let the end user handle the errors as they see fit
  • j

    J0

    10/13/2021, 1:08 PM
    yep! I believe that was an initial prototype. Again, PRs welcome -- if not we'll add it into the roadmap
  • a

    anand

    10/13/2021, 2:15 PM
    I'll make a PR to add async support to the storage APIs, I'll add this as well in there 😄
  • j

    J0

    10/13/2021, 2:19 PM
    thanks! After you open the PR do DM me -- would love to send you some swag 🙂
  • t

    Tejas

    10/14/2021, 5:04 PM
    hey! i was using supabase.py and when i try to fetch the insertion field with the timestamp, it gives me the time in UTC. is there any way to convert this to the time since unix epoch or something?
  • t

    Tejas

    10/14/2021, 5:04 PM
    comparing 2 dates is a bit of pain 😅
  • a

    anand

    10/14/2021, 5:18 PM
    you can pass the string timestamp returned by the query into
    datetime.datetime.fromisoformat
    which will give you
    datetime.datetime
    objects that will be easier to compare
  • a

    anand

    10/14/2021, 5:18 PM
    https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat
  • t

    Tejas

    10/14/2021, 5:25 PM
    thanks a lot!
  • a

    anand

    10/14/2021, 5:25 PM
    👌
  • a

    anand

    10/14/2021, 5:26 PM
    it'd be nice if the library would convert date/timestamps to corresponding objects automatically 🤔
  • t

    Tejas

    10/14/2021, 5:26 PM
    yeah
  • a

    anand

    10/14/2021, 5:26 PM
    might try PRing that in once I get the time 😄
  • t

    Tejas

    10/14/2021, 5:26 PM
    woo
  • t

    Tejas

    10/14/2021, 5:26 PM
    :D
  • t

    Tejas

    10/14/2021, 5:26 PM
    thanks
  • a

    anand

    10/14/2021, 5:35 PM
    looking through postgrest source, it doesn't seem easy 😦 the library does no conversions, just returns the json response
  • d

    Deleted User

    10/14/2021, 5:51 PM
    I'm working in
    gotrue-py
    for add
    dataclasses
    to responses, later, I can be follow with
    postgrest-py
  • a

    anand

    10/14/2021, 5:59 PM
    👌
  • a

    anand

    10/14/2021, 5:59 PM
    I've added dataclasses to some responses in my storage buckets PR
  • a

    anand

    10/16/2021, 4:31 PM
    heyo, looking for feedback on PR #61; what does everyone else think about putting both sync/async methods on the same class? i can understand how it could turn out to be a little confusing, so I'm open to re-writing it as separate classes as well
  • d

    Deleted User

    10/17/2021, 6:45 PM
    https://github.com/supabase-community/supabase-py/pull/61#issuecomment-945169360
  • d

    Deleted User

    10/17/2021, 9:14 PM
    @J0 @User I'm working in this PR, I would like if you could take a look at it, only the testing part remains, fixing the current tests as well as matching the tests with the JS client. https://github.com/supabase-community/gotrue-py/pull/23
1...456...19Latest