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

Call out breaking change in 5.3.0 #1821

Open
mrcljx opened this issue Nov 10, 2023 · 3 comments
Open

Call out breaking change in 5.3.0 #1821

mrcljx opened this issue Nov 10, 2023 · 3 comments

Comments

@mrcljx
Copy link

mrcljx commented Nov 10, 2023

I spent two hours trying to figure out why Kombu suddenly started decoding datetime objects. After searching the issues, I learned this was a fix of a long-standing regression.

But since 5.2.4 had this issue for 15 months and people will have written code based on that behavior, it would be great if this was called out in the changelog, maybe even offering a workaround:

kombu.serialization.unregister("json")
kombu.serialization.register(
    "json",
    json.dumps,
    json.loads,
    content_type="application/json",
    content_encoding="utf-8",
)
@auvipy
Copy link
Member

auvipy commented Nov 11, 2023

We generally accept breaking changes in 5.2.0 and 5.3.0 versions. the changes were documented but due to some problem in CI release note script it was overridden twice. would you mind share some workaround so that I can re add them to the 5.3.x upgrade consideration?

@mrcljx
Copy link
Author

mrcljx commented Nov 11, 2023

I understand the need for this breaking change. It just came as a surprise when upgrading Celery, so a callout was all I needed. 🙂

I'm going forward with this workaround (our test suite passes again):

kombu.serialization.unregister("json")
kombu.serialization.register(
    "json",
    json.dumps, # maybe: orjson
    json.loads,
    content_type="application/json",
    content_encoding="utf-8",
)

Could be that this workaround is flawed for messages in flight - I couldn't really see whether 5.2 would also emit __type__ for some fields that the above decoder wouldn't be able to handle.

Off-topic: I haven't seen the custom JSON coding behavior defined anywhere. Would be great to have a blurb (around __type__ and __value__) in the docs at least. Especially as json is considered portable in contrast to pickle.

@auvipy
Copy link
Member

auvipy commented Nov 11, 2023

I highly appreciate your inputs here. I actually forgot. Now I will revisit the release notes again to mention these type of un intended breaking changes and work around to consider before upgrade. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants