feat: add labels to TaskiqAdminMiddleware requests#532
Merged
s3rius merged 1 commit intotaskiq-python:masterfrom Nov 5, 2025
Merged
feat: add labels to TaskiqAdminMiddleware requests#532s3rius merged 1 commit intotaskiq-python:masterfrom
s3rius merged 1 commit intotaskiq-python:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for including task labels in the TaskiqAdminMiddleware payloads sent to the admin API. The middleware now sends the labels field from TaskiqMessage to the admin API endpoints for both queued and started task events.
Key changes:
- Added
labelsfield to payloads inpost_sendandpre_executemethods - Updated test fixture to include complex label data with datetime objects, timedelta, and nested dictionaries
- Enhanced test assertions to verify labels are included in payloads
- Exported TaskiqAdminMiddleware in the middlewares init.py
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| taskiq/middlewares/taskiq_admin_middleware.py | Added labels field to request payloads in post_send and pre_execute methods; refactored imports to use explicit module paths |
| tests/middlewares/test_taskiq_admin_middleware.py | Added complex label data to test fixture and updated assertions to verify labels are included in payloads |
| taskiq/middlewares/init.py | Exported TaskiqAdminMiddleware in module's public API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
s3rius
approved these changes
Nov 5, 2025
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.
Changes
labelsin the payloads sent by theTaskiqAdminMiddleware;TaskiqAdminMiddlewareis now exported in the__init__.pyfile, making it available for import from thetaskiq.middlewares;Context
I want to implement action to run task with same parameters from admin panel (for retry by hand for example). It's already possible with args/kwargs, but I also want to kick task with same labels.