You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I found that the signature of dataclass does not support field name alias which is defined with std-dataclass field metadata, even though the "ge" and so on validations are supported. Is this expected behavior at pydantic v2?
Example Code
fromdataclassesimportfieldfrompydantic.dataclassesimportdataclass, Field@dataclassclassA:
a: int=field(metadata={"ge": 1, "alias": "aa"})
# In [3]: A.__signature__# Out[3]: <Signature (a: int) -> None> # This should be "<Signature (aa: int) -> None>"# The "ge" validation is supported# In [4]: A(aa=0)# ValidationError: 1 validation error for A# aa# Input should be greater than or equal to 1 [type=greater_than_equal, input_value=0, input_type=int]# For further information visit https://errors.pydantic.dev/2.5/v/greater_than_equal
Initial Checks
Description
Hello, I found that the signature of dataclass does not support field name alias which is defined with std-dataclass field metadata, even though the "ge" and so on validations are supported. Is this expected behavior at pydantic v2?
Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: