Describe the bug
I get unexpected argument warning for model_*
attributes, and attribute names not start with model_
correctly.
I set protected_namespaces
to empty to avoid Pydantic v2 warning.
But it seems that pydantic-pycharm-plugin
will automatically filter out the attributes starting with model_*
, in order to avoid display the original members of BaseModel
. Do not know any better solution? If there is no other way, I can only consider renaming the attribute.
Thanks!
To Reproduce
Here is an example:
class ModelDetail(BaseModel):
id: str = Field(
...,
description='Model unique id',
example='627490893523cd3e2617819e',
)
model_type: str = Field(
...,
description='Model type',
example='detector',
)
model_ver: str = Field(
...,
description='Model version',
example='1.0.0',
)
model_config = ConfigDict(
protected_namespaces=()
)
# Here PyCharm shows unexpected argument warning
ModelDetail(
id='1',
model_type='detector',
model_ver='1.0.0',
)
Expected behavior
Without warning.
Environments (please complete the following information):
Additional context
Add any other context about the problem here.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too