Copilot commented on code in PR #69087:
URL: https://github.com/apache/airflow/pull/69087#discussion_r3486603713
##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -701,22 +701,24 @@ def prepare_callback_bundle(self, request:
CallbackRequest) -> BaseDagBundle | N
Return the bundle to run the callback against, or ``None`` to skip the
callback.
Default implementation looks the bundle up via
:class:`DagBundlesManager` and, for
- versioned requests on bundles that support versioning, calls
``bundle.initialize()``.
- Override to source the bundle from an API.
+ bundles that support versioning, calls ``bundle.initialize()`` so
``bundle.path`` is
+ resolved before the caller reads it. This happens even when
``request.bundle_version``
+ is ``None`` (e.g. ``disable_bundle_versioning=True``), in which case
the bundle resolves
+ its current effective version. Override to source the bundle from an
API.
"""
try:
bundle = DagBundlesManager().get_bundle(name=request.bundle_name,
version=request.bundle_version)
except ValueError:
self.log.error("Bundle %s no longer configured, skipping
callback", request.bundle_name)
return None
- if bundle.supports_versioning and request.bundle_version:
+ if bundle.supports_versioning:
try:
bundle.initialize()
except Exception:
self.log.exception(
"Error initializing bundle %s version %s for callback,
skipping",
request.bundle_name,
- request.bundle_version,
+ request.bundle_version or "latest",
)
Review Comment:
The log formatting uses `request.bundle_version or "latest"`, which will
also replace an empty-string version (falsy but potentially valid) with
"latest". Elsewhere in this module empty-string versions are treated as valid
values, so this can make error logs misleading for pinned-but-empty versions.
Use an explicit `is None` check instead of truthiness.
--
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]