Describe the bug
A clear and concise description of what the bug is.
@pydantic.dataclasses.dataclass's __init__ type hint stop working
To Reproduce
Steps to reproduce the behavior:
install ide, plugin and pydantic
copy file content
try auto-complete
and it's not woking
Expected behavior
A clear and concise description of what you expected to happen.
should work as stdlib dataclasses
Screenshots
If applicable, add screenshots to help explain your problem.
Also, gif movies are recommended.
Environments (please complete the following information):
IDE: PyCharm Pro 2024.1
OS: win10
Pydantic Version: 2.7.0
Plugin version: 0.4.12
Python version: 3.11.9
Additional context
Add any other context about the problem here.
import enum
import pydantic.dataclasses
@enum.verify(enum.UNIQUE)
class SeedingStrategy(enum.Enum):
Rolling = "rolling"
Reserve = "reserve"
@enum.verify(enum.UNIQUE)
class Website(enum.StrEnum):
a = "a"
b = "b"
def category(self):
if self in [e for e in Website]:
return self
raise Exception("missing category config")
@pydantic.dataclasses.dataclass
class Config:
site: Website
cluster: str
strategy: SeedingStrategy
qb_category: str
qb_max_queue: int = 5
qb_tags: list = pydantic.Field([])
sample_rate: float = pydantic.Field(default=1, gt=0, le=1)
if __name__ == "__main__":
Config(sa|) # <- cursor here
emmmm, this can be fixed by changing import pydantic to from pydantic import dataclasses and replace @pydantic.dataclasses.dataclass with @dataclasses.dataclass
Describe the bug A clear and concise description of what the bug is.
@pydantic.dataclasses.dataclass
's__init__
type hint stop workingTo Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen. should work as stdlib
dataclasses
Screenshots If applicable, add screenshots to help explain your problem. Also, gif movies are recommended.
Environments (please complete the following information):
Additional context Add any other context about the problem here.