| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Did you try pyright without strict? |
Sorry, something went wrong.
|
@alejandrodnm without strict it looks a lot better: 4 errors, 0 warnings, 0 informations But this allows untyped functions and Any returns which essentially allows circumventing the type checker altogether. Not great imo. For reference this is how it looks with strict: 301 errors, 0 warnings, 0 informations |
Sorry, something went wrong.
|
The main problem is that some libraries in the python ecosystem still don't have types (noteably asyncpg and pgvector). So for Asyncpg I (or rather Claude) typed the functions as returning an asyncpg.Record and simply ignored the error that Any is not a Record. Pyright works differently, I can ignore the error in that location but it doesn't trust my annotation afterwards it instead build a union type Record | Unknown where Unknown is equivalent to mypy untyped Any. This then throws errors in the rest of the codebase because of course I handle it as if it was a Record everywhere. I haven't really figured out how to change this behaviour, there doesn't seem to be away to say: Trust my annotation. The only recommendation that pyright has for untyped third party libraries is to write stub files yourself, which works but honestly is a bit too much effort right now. Asyncpg e.g. has a PR to add types since 4 years here. I get that in pgai we use pyright and would need to use the same typechecker. It just seems that once you have some sort of untyped dependencies the pyright strict mode no longer really works. Kinda sucks 🤷♂️ |
Sorry, something went wrong.
|
I've fixed the typing issues by providing stubs for everything in use. Took a while but with Claudes help it was doable. So now we can use pyright in strict and dont have to change anything about the config for pgai. @alejandrodnm |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The PR is based on the ruff changes earlier so overall it does:
Note that the recording is extremely large because tiktoken downloads the whole encoding vocab through an http request.
I've added a filter for removing authorization tokens and cookies to vcr.py. But I do feel like this is a bit of a time bomb until someone accidentally commits a secret. If a filter doesn't catch a header and the author doesn't see it before pushing 🤷♂️