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

Issue with ormsgpack.OPT_SERIALIZE_PYDANTIC in pydantic pydantic >= 2.10.0 #311

Open
leon11s opened this issue Nov 24, 2024 · 3 comments
Open

Comments

@leon11s
Copy link

leon11s commented Nov 24, 2024

Hey!

After an issue in our app, I started some debugging. After some time, I found an issue with running ormsgpack==1.6.0 with pydantic >= 2.10.0.

Example:

from pydantic import BaseModel
import ormsgpack

class UserUsageOverview(BaseModel):
	total_successful_referrals: int
	current_plan_name: str

usage = UserUsageOverview(total_successful_referrals=5, current_plan_name="test")
value_serialized = ormsgpack.packb(usage, option=ormsgpack.OPT_SERIALIZE_PYDANTIC)

The code give the following error:

Traceback (most recent call last):
File "", line 1, in
TypeError: Type is not msgpack serializable: UserUsageOverview

With previous versions of Pydantic, things work just fine. I tried in Python versions 3.11.9 and 3.12.7

@exg
Copy link
Collaborator

exg commented Nov 24, 2024

Hi, thanks for the report. I fixed the issue in #308 and plan to release a new version with the fix soon.

@awakim
Copy link

awakim commented Nov 27, 2024

Hi,

Is there an ETA for the release of this fix?

Cheers!

@talongao
Copy link

Hi,
Could you please inform me when the new version will be released?

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

4 participants