-
Notifications
You must be signed in to change notification settings - Fork 16k
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
Docs: Add 'Optional' to installation section to fix an issue #28902
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I'm guessing you didn't run the above code because |
Hi @efriis , thanks for your review! This is not a tutorial where we follow instructions from top to bottom, it's a how-to guide where we select the part we need to apply. Each method should be an independent working example, because they're different methods serving different purposes. So, in my case I don't need to copy Pydantic example from above so that TypedDict or JSON work. and btw, this is good for consistency, as you can see on the other section "Choosing between multiple schemas" we imported Optional again on this line "from typing import Optional, Union" although we imported it early, because they're independent code blocks which makes more sense. Thanks! |
works for me - let's switch it to import from the same package instead of typing_extensions here though |
…in-ai#28902) Problem: "Optional" object is used in one example without importing, which raises the following error when copying the example into IDE or Jupyter Lab ![image](https://github.com/user-attachments/assets/3a6c48cc-937f-4774-979b-b3da64ced247) Solution: Just importing Optional from typing_extensions module, this solves the problem! --------- Co-authored-by: Erick Friis <[email protected]>
Problem:
"Optional" object is used in one example without importing, which raises the following error when copying the example into IDE or Jupyter Lab
Solution:
Just importing Optional from typing_extensions module, this solves the problem!