Skip to content
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

Ignore Pydantic dataclasses #728

Open
charles-dyfis-net opened this issue Aug 28, 2024 · 1 comment
Open

Ignore Pydantic dataclasses #728

charles-dyfis-net opened this issue Aug 28, 2024 · 1 comment

Comments

@charles-dyfis-net
Copy link

Description

While Pydantic dataclasses have a __dataclass_fields__ attribute, their users may have validation logic, default_factory configuration, and other settings that msgspec does not enforce.

Rather than appearing to support these types but silently ignoring validation steps and defaults, it makes more sense to treat them as explicitly unsupported.

@timinou
Copy link

timinou commented Nov 3, 2024

Allow me to drop in :)

I'm writing a framework that unfortunately has to handle a few libraries that use Pydantic. I think having a basic msgspec <> Pydantic model translation would help me leverage the outputs of those libraries without having to create a second source of truth within my code. Even if PR #729 gets accepted, a semi-blessed match-case statement here with msgspec inspect's type would go a long way in ensuring some type of compatibility.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants