This is an automated email from the ASF dual-hosted git repository.
Miretpl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 299ca2c8580 Fix malformed GitDagBundle error message for missing
repository path (#70622)
299ca2c8580 is described below
commit 299ca2c8580773b2d51b7988aacd582695940d58
Author: WonYong Jang <[email protected]>
AuthorDate: Fri Aug 7 05:56:34 2026 +0900
Fix malformed GitDagBundle error message for missing repository path
(#70622)
---
generated/known_airflow_exceptions.txt | 2 +-
providers/git/src/airflow/providers/git/bundles/git.py | 2 +-
providers/git/tests/unit/git/bundles/test_git.py | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/generated/known_airflow_exceptions.txt
b/generated/known_airflow_exceptions.txt
index 2c82d85dfc6..b9615408a99 100644
--- a/generated/known_airflow_exceptions.txt
+++ b/generated/known_airflow_exceptions.txt
@@ -199,7 +199,7 @@
providers/fab/src/airflow/providers/fab/auth_manager/fab_auth_manager.py::3
providers/fab/src/airflow/providers/fab/auth_manager/models/db.py::1
providers/fab/src/airflow/providers/fab/www/extensions/init_security.py::1
providers/facebook/src/airflow/providers/facebook/ads/hooks/ads.py::2
-providers/git/src/airflow/providers/git/bundles/git.py::5
+providers/git/src/airflow/providers/git/bundles/git.py::4
providers/git/tests/unit/git/bundles/test_git.py::1
providers/github/src/airflow/providers/github/operators/github.py::2
providers/github/src/airflow/providers/github/sensors/github.py::3
diff --git a/providers/git/src/airflow/providers/git/bundles/git.py
b/providers/git/src/airflow/providers/git/bundles/git.py
index f7b8de1a4a4..917e3e6a333 100644
--- a/providers/git/src/airflow/providers/git/bundles/git.py
+++ b/providers/git/src/airflow/providers/git/bundles/git.py
@@ -271,7 +271,7 @@ class GitDagBundle(BaseDagBundle):
self.repo = Repo(self.repo_path)
except NoSuchPathError as e:
# Protection should the bare repo be removed manually
- raise AirflowException("Repository path: %s not found",
self.bare_repo_path) from e
+ raise FileNotFoundError(f"Repository path: {self.bare_repo_path}
not found") from e
except (InvalidGitRepositoryError, GitCommandError) as e:
self._log.warning(
"Repository clone/open failed, cleaning up and retrying",
diff --git a/providers/git/tests/unit/git/bundles/test_git.py
b/providers/git/tests/unit/git/bundles/test_git.py
index 6826ae76b6c..0726d0a5fc8 100644
--- a/providers/git/tests/unit/git/bundles/test_git.py
+++ b/providers/git/tests/unit/git/bundles/test_git.py
@@ -1234,10 +1234,10 @@ class TestGitDagBundle:
with
mock.patch("airflow.providers.git.bundles.git.Repo.clone_from") as mock_clone:
mock_clone.side_effect = NoSuchPathError("Path not found")
bundle = GitDagBundle(name="test", tracking_ref="main")
- with pytest.raises(AirflowException) as exc_info:
+ with pytest.raises(FileNotFoundError) as exc_info:
bundle._clone_repo_if_required()
- assert "Repository path: %s not found" in str(exc_info.value)
+ assert str(exc_info.value) == f"Repository path:
{bundle.bare_repo_path} not found"
@patch.dict(os.environ, {"AIRFLOW_CONN_MY_TEST_GIT": '{"host":
"something", "conn_type": "git"}'})
@pytest.mark.parametrize(