-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Exclude pydantic 2.10.2 #1562
Exclude pydantic 2.10.2 #1562
Conversation
The CI installs from poetry lock file (for reproducibility and to avoid resolving deps all the time), which uses pydantic 1. We might consider testing both 1 and 2, although we can then start doing that with a frightening about of deps! Trying install without lock file now, but it's taking forever to lock dependencies... Ergo; feedback from community on this one welcome. |
Hi @dokterbob, Pydantic maintainer here. A couple things to note:
|
Ok so turns out the change is unrelated to my second bullet point. In the chainlit/backend/chainlit/config.py Lines 31 to 37 in 3f31454
Later in the same module, you are making use of these type annotations in Pydantic dataclasses, e.g.: chainlit/backend/chainlit/config.py Lines 268 to 271 in 3f31454
At runtime, As of today, Pydantic does not inspect the parameters of the def some_func() -> None:
return None
class Model(BaseModel):
my_func: Callable[[int, str, "SomeTypeThatDoesntExist"], bool]
Model(my_func=some_func) # Validation succeeds In 2.10.2, as a consequence of a small performance improvement, we now always try to evaluate the forward annotation, even for
What I would suggest is:
|
Thank you so much @Viicos, for this excellent contribution. I only afforded a quick look and it seemed that the similar error message together with the recent release suggested a bug on your end. Appreciate your clarification and super appreciate your fix!
:') Every pass I make I refactor a bit -- eventually we should not have to avoid type checking anywhere. But there's a long way to go. ;) |
Addresses #1543, #1544, #1556.
Ref: pydantic/pydantic#11031