arifrhm commented on code in PR #77046:
URL: https://github.com/apache/airflow/pull/77046#discussion_r4602563657
##########
providers/common/messaging/src/airflow/providers/common/messaging/triggers/msg_queue.py:
##########
@@ -50,12 +50,12 @@ class MessageQueueTrigger(BaseEventTrigger):
This makes it easy to switch providers without modifying the trigger.
:param scheme: The queue scheme (e.g., 'kafka', 'redis+pubsub', 'sqs').
Used for provider matching.
- :param queue: **Deprecated** The queue identifier (URI format). If
provided, this takes precedence over scheme parameter.
- This parameter is deprecated and will be removed in future versions.
Use the 'scheme' parameter instead.
- :param trigger_queue: Assign this trigger to a specific trigger queue (see
+ :param queue: Assign this trigger to a specific trigger queue (see
:ref:`config:triggerer__queues_enabled` and the ``--queues`` option of
``airflow triggerer``).
- Named differently from the ``queue`` parameter above, which is the
deprecated broker queue URI
- and cannot be repurposed for triggerer routing without breaking
existing callers.
+ If ``scheme`` is not provided or the value matches a registered broker
queue pattern, this parameter
+ is treated as the deprecated broker queue URI for backward
compatibility.
Review Comment:
Updated the docstring to mention that values containing `"://"` are also
treated as legacy broker queue URIs for backward compatibility.
##########
providers/common/messaging/tests/unit/common/messaging/triggers/test_msg_queue.py:
##########
@@ -212,12 +212,45 @@ async def mock_run():
class TestMessageQueueTriggerScheme:
"""Test cases for the new scheme parameter functionality."""
- @pytest.mark.usefixtures("collect_queue_param_deprecation_warning")
- def test_queue_takes_precedence_over_scheme(self):
- """Test that queue parameter takes precedence when both are
provided."""
- trigger = MessageQueueTrigger(queue=PROVIDER_1_QUEUE,
scheme=PROVIDER_2_SCHEME)
- assert trigger.queue_uri == PROVIDER_1_QUEUE
- assert trigger.scheme is None
+ def test_legacy_queue_uri_with_scheme_keeps_uri_matching(self):
Review Comment:
Consolidated the 3 tests into a single parametrized test
`test_legacy_queue_with_scheme_keeps_uri_matching`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]