arifrhm commented on code in PR #77046:
URL: https://github.com/apache/airflow/pull/77046#discussion_r4602224200


##########
providers/common/messaging/src/airflow/providers/common/messaging/triggers/msg_queue.py:
##########
@@ -68,32 +68,47 @@ class MessageQueueTrigger(BaseEventTrigger):
     def __init__(
         self,
         *,
-        queue: str | None = None,
         scheme: str | None = None,
+        queue: str | None = None,
         trigger_queue: str | None = None,
         **kwargs: Any,
     ) -> None:
-        # Stored under our own name rather than through 
`BaseEventTrigger.__init__(queue=...)` so this
-        # works regardless of the installed airflow-core version, see `queue` 
property below.
-        self._trigger_queue = trigger_queue
-
-        if queue is None and scheme is None:
-            raise ValueError("Either `queue` or `scheme` parameter must be 
provided.")
-
-        # For backward compatibility, queue takes precedence
-        if queue is not None:
+        if queue is not None and (
+            scheme is None or any(provider.queue_matches(queue) for provider 
in MESSAGE_QUEUE_PROVIDERS)
+        ):

Review Comment:
   Restored the `"://"` check alongside `queue_matches` and added 
`test_legacy_queue_uri_with_unmatched_provider_keeps_uri_matching` to verify 
that unmatched broker URIs containing `://` continue to be treated as legacy 
broker URIs rather than trigger queues.



##########
devel-common/src/tests_common/test_utils/common_msg_queue.py:
##########
@@ -29,7 +29,7 @@ def collect_queue_param_deprecation_warning():
     """Collect deprecation warnings for queue parameter."""
     with pytest.warns(
         AirflowProviderDeprecationWarning,
-        match="The `queue` parameter is deprecated and will be removed in 
future versions. Use the `scheme` parameter instead and pass configuration as 
keyword arguments to `MessageQueueTrigger`.",
+        match=r"(The `queue` parameter is deprecated|Passing the broker queue 
URI as `queue` is deprecated)",

Review Comment:
   Removed the unused first alternative and simplified the match pattern as 
suggested.



-- 
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]

Reply via email to