Fix type annotations examples#496
Merged
rm-openai merged 4 commits intoApr 14, 2025
Merged
Conversation
rm-openai
requested changes
Apr 14, 2025
Collaborator
rm-openai
left a comment
There was a problem hiding this comment.
Actually you can just do from __future__ import annotations and these type errors will go away on 3.9
Contributor
Author
|
Yes, I thought that was the solution, but it doesn't work when using For example, I got the following error: Let me know if I'm wrong and I have to change the pull request. |
rm-openai
previously approved these changes
Apr 14, 2025
Collaborator
|
cool - can you fix lint please? |
Collaborator
|
oh wait lint is complaining about the exact thing i talked about hmm |
Collaborator
|
I think you can do what it says and add https://pypi.org/project/eval-type-backport/, based on pydantic/pydantic#7873 |
Contributor
Author
|
I added the library to the dependencies as suggested, it should work now, tests passed |
rm-openai
approved these changes
Apr 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I fixed the type annotations errors for pydantic objects in some examples as noted in #490 .
When running
make lintthe following error occurs "UP007 UseX | Yfor type annotations". If you know how to ignore it I will be happy to edit the pull request, thanks.