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

Fix tests broken by moving Message to dataclass #516

Merged
merged 2 commits into from
Dec 28, 2022

Conversation

orsinium
Copy link
Contributor

@orsinium orsinium commented Dec 8, 2022

The changes in #513 broke tests a bit that relied on Message being a namedtuple, see comment #513 (comment) by @anton-petrov.

  1. Add pipe_target into Message.options inside of pipeline in the reverse order, so that the message dump inside pipe_target recursively contains pipe_target of the next message.
  2. Add Message.__lt__, so that messages can be sorted. The sorting order is the same as it was for namedtuple.
  3. Make sure Message.args is a tuple when restoring from a dump.

dramatiq/composition.py Outdated Show resolved Hide resolved
@Bogdanp Bogdanp merged commit a41f3fc into Bogdanp:master Dec 28, 2022
@Bogdanp
Copy link
Owner

Bogdanp commented Dec 28, 2022

Thanks!

@orsinium orsinium deleted the fix-namedtuple-migration branch December 28, 2022 08:53
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.

2 participants