keith991001 opened a new pull request, #73168:
URL: https://github.com/apache/airflow/pull/73168
Implements **option (a)** from #72916: `BaseMessageQueueProvider` declares
`@abstractmethod`s but never inherited `abc.ABC`, so an incomplete subclass
instantiates silently, and its unimplemented `queue_matches` returns `None` —
making the provider silently unmatched in `MessageQueueTrigger` dispatch
instead of failing loudly. Three in-tree providers (google pubsub, redis, azure
service bus) rely on that gap by implementing only `trigger_class` + `scheme`.
**The change aligns the contract with reality instead of breaking the
scheme-only providers:**
- `BaseMessageQueueProvider` now inherits `abc.ABC`
- `trigger_class` stays the only abstract method — a subclass without it now
fails at instantiation with `TypeError` instead of silently never matching
- `queue_matches` / `trigger_kwargs` become concrete defaults (`return
False` / `return {}`), documented as the scheme-only baseline to override for
queue-URI dispatch
- No provider changes needed: verified by running the queue/trigger test
suites of all six in-tree subclasses (amazon sqs, apache.kafka, ibm.mq, redis,
microsoft.azure, google) — all green
Test module updated accordingly: contract-enforcement tests (only
`trigger_class` abstract, incomplete subclass fails loudly, scheme-only shape
instantiates) plus the dispatch defaults.
If maintainers prefer option (b) (keep all three abstract and add the
missing methods to the three scheme-only providers) I'm happy to switch
direction.
closes: #72916
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Fable 5)
Generated-by: Claude Code (Fable 5) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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]