You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the @job decorator with delay prevents the correct class from being used inside the job.
However if the method used is an instance method and not a class method, the code runs as expected.
The text was updated successfully, but these errors were encountered:
This is related to the @classmethod decorator coming after @job, and that the decorator will wrap the function during class construction and when finally using .delay(...) it will internally try to determine the type of the callable, but it will incorrectly deduce it as a function
This seems like it would also be a problem for instance methods too, since on class construction they wouldn't be bound yet.
The only way I think you would be able to fix this is to make the @job decorator return a new object implementing the descriptor protocol which would allow getting the object after class creation, but you'd probably also need to make sure it properly emulated any other decorators and those would all have to be applied so the @job decorator sees them
Test code:
test_subclasses_with_decorator
fails with:Using the
@job
decorator withdelay
prevents the correct class from being used inside the job.However if the method used is an instance method and not a class method, the code runs as expected.
The text was updated successfully, but these errors were encountered: