You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2026/05/10 00:03:49 UTC

(airflow) branch main updated: feat: add code quality rule to flag new usage of AirflowException (#66640)

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

potiuk 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 393b74fb935 feat: add code quality rule to flag new usage of AirflowException (#66640)
393b74fb935 is described below

commit 393b74fb9354f3a107c8739281c35ef677ad9599
Author: Aaron Chen <na...@gmail.com>
AuthorDate: Sat May 9 17:03:39 2026 -0700

    feat: add code quality rule to flag new usage of AirflowException (#66640)
---
 .github/instructions/code-review.instructions.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/instructions/code-review.instructions.md b/.github/instructions/code-review.instructions.md
index 2dc865b71be..86a21e5471e 100644
--- a/.github/instructions/code-review.instructions.md
+++ b/.github/instructions/code-review.instructions.md
@@ -32,6 +32,7 @@ Use these rules when reviewing pull requests to the Apache Airflow repository.
 - **Flag any `@lru_cache(maxsize=None)`.** This creates an unbounded cache — every unique argument set is cached forever. Note: `@lru_cache()` without arguments defaults to `maxsize=128` and is fine.
 - **Flag any heavy import** (e.g., `kubernetes.client`) in multi-process code paths that is not behind a `TYPE_CHECKING` guard.
 - **Flag any file, connection, or session opened without a context manager or `try/finally`.**
+- **Flag any new `raise AirflowException` usage.** The community has stopped adding new ones (enforced by the `check-no-new-airflow-exceptions` prek hook) — prefer Python's standard exceptions (`ValueError`, `TypeError`, `OSError`), or a dedicated class in the appropriate `exceptions.py`. **Do not suggest changing specific exceptions back to `AirflowException`.**
 
 ## Testing Requirements