This is an automated email from the ASF dual-hosted git repository.

jscheffl 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 431c40ba13d Remove AirflowException from Edge Example Dag (#64975)
431c40ba13d is described below

commit 431c40ba13dcdb8eb722fd9ea679436eeee14bae
Author: Jens Scheffler <[email protected]>
AuthorDate: Thu Apr 9 23:26:15 2026 +0200

    Remove AirflowException from Edge Example Dag (#64975)
---
 .../src/airflow/providers/edge3/example_dags/win_test.py      | 11 +++++------
 scripts/ci/prek/known_airflow_exceptions.txt                  |  1 -
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git 
a/providers/edge3/src/airflow/providers/edge3/example_dags/win_test.py 
b/providers/edge3/src/airflow/providers/edge3/example_dags/win_test.py
index a3527e4a4e2..0f021bfebc0 100644
--- a/providers/edge3/src/airflow/providers/edge3/example_dags/win_test.py
+++ b/providers/edge3/src/airflow/providers/edge3/example_dags/win_test.py
@@ -28,7 +28,7 @@ from __future__ import annotations
 import os
 from collections.abc import Callable, Container, Sequence
 from datetime import datetime
-from subprocess import STDOUT, Popen
+from subprocess import STDOUT, Popen, SubprocessError
 from time import sleep
 from typing import TYPE_CHECKING, Any
 
@@ -36,7 +36,6 @@ from airflow.models import BaseOperator
 from airflow.models.dag import DAG
 from airflow.models.variable import Variable
 from airflow.providers.common.compat.sdk import (
-    AirflowException,
     AirflowNotFoundException,
     AirflowSkipException,
 )
@@ -125,7 +124,7 @@ class CmdOperator(BaseOperator):
        * - `skip_on_exit_code` (default: 99)
          - raise :class:`airflow.exceptions.AirflowSkipException`
        * - otherwise
-         - raise :class:`airflow.exceptions.AirflowException`
+         - raise :class:`subprocess.SubprocessError`
 
     .. warning::
 
@@ -210,9 +209,9 @@ class CmdOperator(BaseOperator):
     def execute(self, context: Context):
         if self.cwd is not None:
             if not os.path.exists(self.cwd):
-                raise AirflowException(f"Can not find the cwd: {self.cwd}")
+                raise SubprocessError(f"Can not find the cwd: {self.cwd}")
             if not os.path.isdir(self.cwd):
-                raise AirflowException(f"The cwd {self.cwd} must be a 
directory")
+                raise SubprocessError(f"The cwd {self.cwd} must be a 
directory")
         env = self.get_env(context)
 
         # Because the command value is evaluated at runtime using the 
@task.command decorator, the
@@ -237,7 +236,7 @@ class CmdOperator(BaseOperator):
         if exit_code in self.skip_on_exit_code:
             raise AirflowSkipException(f"Command returned exit code 
{exit_code}. Skipping.")
         if exit_code != 0:
-            raise AirflowException(f"Command failed. The command returned a 
non-zero exit code {exit_code}.")
+            raise SubprocessError(f"Command failed. The command returned a 
non-zero exit code {exit_code}.")
 
         return self.output_processor(outs)
 
diff --git a/scripts/ci/prek/known_airflow_exceptions.txt 
b/scripts/ci/prek/known_airflow_exceptions.txt
index 76e3994c549..9cd3d52cd1f 100644
--- a/scripts/ci/prek/known_airflow_exceptions.txt
+++ b/scripts/ci/prek/known_airflow_exceptions.txt
@@ -197,7 +197,6 @@ 
providers/discord/src/airflow/providers/discord/operators/discord_webhook.py::1
 providers/docker/src/airflow/providers/docker/decorators/docker.py::1
 providers/docker/src/airflow/providers/docker/hooks/docker.py::3
 providers/docker/src/airflow/providers/docker/operators/docker_swarm.py::2
-providers/edge3/src/airflow/providers/edge3/example_dags/win_test.py::3
 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

Reply via email to