Optional[level] seems like optional but it is actually not optional, it gives `None` if no value is specified during initialization instead of Optional we can use `Union[Level, None]` or `Level | None` (in >= python3.10)
PydanticDeprecatedSince20: Pydantic V1 style `@validator` validators are deprecated. You should migrate to Pydantic V2 style `@field_validator` validators
🔴 - If you enjoyed this video. Please leave a like and subscribe :)
Do some express typescript sir
Great tutorial about Pydantic 🤘, awesome as always Fransis
Taghi!! Thank you bro!
Very helpful video! thanks for making 👍
You're more than welcome :)
Great crash course!
You are more than welcome!!
Optional[level] seems like optional but it is actually not optional, it gives `None` if no value is specified during initialization
instead of Optional we can use `Union[Level, None]` or `Level | None` (in >= python3.10)
Isn't this how optional values are defined in Python callable signatures? By supplying some default value, often None? :)
PydanticDeprecatedSince20:
Pydantic V1 style `@validator` validators are deprecated.
You should migrate to Pydantic V2 style `@field_validator` validators
applying print function on `values` gives `ValidationInfo` instance.
from there `values.data` can be used to get the values as dict.
level: Optional[Level] = None
Great video! I am looking forward to pydantic 2. Another things I like is the @validate_arguments decorator.