Vamsi-klu commented on PR #69845:
URL: https://github.com/apache/airflow/pull/69845#issuecomment-4966077308

   Had a look through this and the guard reads right to me. `full_file_path()` 
in `models/errors.py` does `DagBundlesManager().get_bundle(...).path`, so 
gating both notification calls in `_update_import_errors` behind 
`get_listener_manager().has_listeners` keeps that bundle instantiation out of 
the parsing transaction when no listener is registered, which is the common 
case. Nice that it reuses the same `has_listeners` check already in `dagbag.py` 
instead of inventing a new signal. The regression test mocking `full_file_path` 
with `assert_not_called()` and then asserting the `ParseImportError` row still 
persists lands right on the behavior that was broken, and as a bonus the 
existing-error branch now skips the extra `select(ParseImportError)` query that 
only ever existed to feed the listener arg.
   


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