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

Closed
leon11s opened this issue Nov 24, 2024 · 4 comments
Closed

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?

@exg
Copy link
Collaborator

exg commented Dec 8, 2024

Sorry for the delay. I released ormsgpack 1.7.0 last week but the workflow failed to upload the wheels to PyPI because of PyO3/maturin#2335. I have been waiting for a new release of https://github.com/pypa/gh-action-pypi-publish with a fix but, as this is taking longer than expected, I have now uploaded the wheels to PyPI manually.

@exg exg closed this as completed Dec 8, 2024
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