limeschnaps opened a new pull request, #69966:
URL: https://github.com/apache/airflow/pull/69966
closes: #69962
## What
`Trigger.submit_event` imported the base `AssetManager` class and called
`AssetManager.register_asset_change(...)` on it, instead of using the
resolved
`asset_manager` singleton like every other call site
(`taskinstance.py`, the public assets REST route). Because
`register_asset_change` is a classmethod invoked on the base class, a custom
manager configured via `[core] asset_manager_class` was silently bypassed for
asset events produced by triggers / asset watchers.
This swaps the import and call to the configured `asset_manager` instance, so
`asset_manager_class` now applies uniformly regardless of how an asset event
is
produced.
## Why
`asset_manager_class` is the only supported extension point for asset-event
handling, and it did not apply to trigger/watcher-produced events — the one
place a custom manager could not be reached.
## Tests
- Added `test_submit_event_uses_configured_asset_manager`: asserts
`submit_event` dispatches through the module-level `asset_manager`
instance.
Fails on `main`, passes with the fix.
- Updated `test_submit_event_no_n_plus_one_for_assets` to patch
`airflow.assets.manager.AssetManager.register_asset_change` (where the
classmethod is defined) so it no longer depends on the removed module
symbol.
--
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]