Skip to content

Add support to dill serializer #406

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

GregoirePelegrin
Copy link

@GregoirePelegrin GregoirePelegrin commented Jun 26, 2024

Fixes #405.
Must be merged along with celery/celery#9100

@GregoirePelegrin GregoirePelegrin changed the title Fix #405 Fix https://github.com/celery/billiard/issues/405 Jun 26, 2024
@GregoirePelegrin GregoirePelegrin changed the title Fix https://github.com/celery/billiard/issues/405 Add support to dill serializer Jun 26, 2024
@GregoirePelegrin
Copy link
Author

I can't seem to find the requirements file to add dill>=0.3.8 in it...

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking of compatibility between dill and pickle

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E ModuleNotFoundError: No module named 'dill'

@GregoirePelegrin
Copy link
Author

Yes, as I've stated in my previous comment, I've failed to locate the requirements file. I haven't been able to include dill, which is the cause of this error. When it comes to the compatibility, the admittedly limited tests I've done have thus far been successful. This said, I am not aware of every uses made by the community, and I only tested simple objects.

@Nusnus Nusnus marked this pull request as draft June 30, 2024 22:43
@Nusnus
Copy link
Member

Nusnus commented Jun 30, 2024

Converting to draft until the PR is ready and working.

Thank you 🙏

@GregoirePelegrin
Copy link
Author

Converting to draft until the PR is ready and working.

Thank you 🙏

I am currently searching for the place to add the dill requirement. It seems there are no packages imported for now, so no requirements.txt exists for the package (not for the tests). I assume that adding the dependency to the test environment would solve the testing issue but would lead to errors when trying to use the package itself. I am not sure how the build works here, so if someone was able to help me with this, I'd be grateful!

@GregoirePelegrin GregoirePelegrin marked this pull request as ready for review July 1, 2024 09:22
@GregoirePelegrin
Copy link
Author

According to the test suite, it seems it is ready for review. Please tell me if it isn't!

@GregoirePelegrin GregoirePelegrin requested a review from auvipy July 1, 2024 09:23
Copy link
Member

@Nusnus Nusnus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears this PR only changes the default from pickle to dill, but the matching celery PR celery/celery#9100 is where the dill is actually “requested”.

Shouldn’t the celery use-case be enough so the billiard changes won’t be needed?
This is a follow-up to my other comment: https://github.com/celery/billiard/pull/406/files#r1663972900

@GregoirePelegrin
Copy link
Author

It appears this PR only changes the default from pickle to dill, but the matching celery PR celery/celery#9100 is where the dill is actually “requested”.

Shouldn’t the celery use-case be enough so the billiard changes won’t be needed? This is a follow-up to my other comment: https://github.com/celery/billiard/pull/406/files#r1663972900

It is necessary to have the dill deserializer here, as it would otherwise be unable to process the message sent by the dill serializer in the matching celery PR celery/celery#9100. I initially only modified (locally) the celery library but the error I was trying to remove was then raised here:

def _recv(timeout, loads=pickle_loads):

This is what led me to also modify the billiard deserializer.

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wah I can see that the CI is passing and there are unit tests added! but are the unit tests running in the CI? can you also add/update some unit tests?

@GregoirePelegrin
Copy link
Author

wah I can see that the CI is passing and there are unit tests added! but are the unit tests running in the CI?

As the test was implemented the same way as the others, and in an already existing file, it indeed should be running the same way as the others.

can you also add/update some unit tests?

What additional tests would you like me to add?

I must also say that I do not understand the pre-commit error? Is it related to this PR or is it a more global issue?

@auvipy
Copy link
Member

auvipy commented Jun 3, 2025

You can ignore the precommit error for now. Btw, why dill and not cloudpickle? Im curious

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

Successfully merging this pull request may close these issues.

Use dill.dumps and dill.loads serialization instead of pickle
3 participants