This is an automated email from the ASF dual-hosted git repository.
weilee pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new 7107afa130b [v3-1-test] Fix: In the log.exception() , the format
specifier for the first parameter is missing (#58295) (#60828)
7107afa130b is described below
commit 7107afa130b2f9b5081485846aa8f1cdc46976ed
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Jan 21 09:49:56 2026 +0800
[v3-1-test] Fix: In the log.exception() , the format specifier for the
first parameter is missing (#58295) (#60828)
Co-authored-by: KUAN-HAO HUANG <[email protected]>
Co-authored-by: Wei Lee <[email protected]>
---
.../src/airflow/dag_processing/bundles/base.py | 2 +-
.../tests/unit/dag_processing/bundles/test_base.py | 28 +++++++++++++++++++++-
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/airflow-core/src/airflow/dag_processing/bundles/base.py
b/airflow-core/src/airflow/dag_processing/bundles/base.py
index 2df62bcf2b8..2f4654382cb 100644
--- a/airflow-core/src/airflow/dag_processing/bundles/base.py
+++ b/airflow-core/src/airflow/dag_processing/bundles/base.py
@@ -414,7 +414,7 @@ class BundleVersionLock:
def _log_exc(self, msg):
log.exception(
- "% name=%s version=%s lock_file=%s",
+ "%s name=%s version=%s lock_file=%s",
msg,
self.bundle_name,
self.version,
diff --git a/airflow-core/tests/unit/dag_processing/bundles/test_base.py
b/airflow-core/tests/unit/dag_processing/bundles/test_base.py
index 7da3baa3b9f..05d00041ac5 100644
--- a/airflow-core/tests/unit/dag_processing/bundles/test_base.py
+++ b/airflow-core/tests/unit/dag_processing/bundles/test_base.py
@@ -24,7 +24,7 @@ import threading
import time
from datetime import timedelta
from pathlib import Path
-from unittest.mock import patch
+from unittest.mock import call, patch
import pytest
import time_machine
@@ -202,6 +202,32 @@ class TestBundleVersionLock:
assert b.lock_file_path is None
assert b.lock_file is None
+ def test_log_exc_formats_message_correctly(self):
+ """Test that _log_exc correctly formats the log message with all
parameters."""
+ from airflow.dag_processing.bundles.base import log as bundle_log
+
+ bundle_name = "test_bundle"
+ bundle_version = "v1.0.0"
+ lock = BundleVersionLock(
+ bundle_name=bundle_name,
+ bundle_version=bundle_version,
+ )
+
+ test_msg = "error when attempting to acquire lock"
+
+ with patch.object(bundle_log, "exception") as mock_exception:
+ lock._log_exc(test_msg)
+
+ assert mock_exception.mock_calls == [
+ call(
+ "%s name=%s version=%s lock_file=%s",
+ test_msg,
+ bundle_name,
+ bundle_version,
+ lock.lock_file_path,
+ )
+ ]
+
class FakeBundle(BaseDagBundle):
@property