Repository navigation
Remove the deprecated TaskBroker.enqueue() - #56
Merged
Merged
Conversation
TaskBroker.enqueue() was renamed to notify() in 0.5, and a broker that still overrode it was called with a DeprecationWarning saying it would be ignored in 0.6. This removes the alias and the backend's fallback to the override, as announced. A broker that overrides only enqueue() now fails in notify() like any other broker failure: the error is logged and the task stays in the database for the worker and the HTTP endpoints. Bundled brokers and the BROKER option are unaffected.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TaskBroker.enqueue()was renamed tonotify()in 0.5. A broker that still overrodeenqueue()kept being called, with aDeprecationWarningsaying it would be ignored in 0.6, and the CHANGELOG's Deprecated entry for 0.5 announced the same. This removes the alias fromTaskBrokerand the backend's fallback to the override before 0.6 is released, asget_auth_handler()was removed in 0.5.A broker that overrides only
enqueue()is no longer called: the backend callsnotify(), which raisesNotImplementedErroronTaskBroker, and logsBroker X failed to notify about task Yat ERROR, as for any broker failure. The task is saved as before, sorun_database_tasksand the HTTP endpoints still pick it up. Code that calledbroker.enqueue()by hand gets anAttributeError. Bundled brokers, theBROKERoption and brokers already onnotify()are unaffected.The tests for the deprecation path in
tests/test_brokers.pyare replaced by tests for the removal: anenqueue()override is not called, the failure is logged, the task staysREADYand no warning is emitted. The CHANGELOG has an entry under Removed, and CONTRIBUTING's example of a deprecation now speaks of it in the past tense.