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 02:12:15 UTC

(airflow) branch main updated: Convert RUNTIME_VARYING_CALLS to frozenset for O(1) membership lookup (#66306)

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 eb341bee29c Convert RUNTIME_VARYING_CALLS to frozenset for O(1) membership lookup (#66306)
eb341bee29c is described below

commit eb341bee29c4b227468449a42ca190376c81594f
Author: Colten <ju...@gmail.com>
AuthorDate: Sun May 10 10:12:07 2026 +0800

    Convert RUNTIME_VARYING_CALLS to frozenset for O(1) membership lookup (#66306)
---
 .../airflow/utils/dag_version_inflation_checker.py | 38 ++++++++++++----------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/airflow-core/src/airflow/utils/dag_version_inflation_checker.py b/airflow-core/src/airflow/utils/dag_version_inflation_checker.py
index f11161116ff..2314b94a126 100644
--- a/airflow-core/src/airflow/utils/dag_version_inflation_checker.py
+++ b/airflow-core/src/airflow/utils/dag_version_inflation_checker.py
@@ -21,24 +21,26 @@ from dataclasses import dataclass
 from enum import Enum
 from pathlib import Path
 
-RUNTIME_VARYING_CALLS = [
-    ("datetime", "now"),
-    ("datetime", "today"),
-    ("datetime", "utcnow"),
-    ("date", "today"),
-    ("time", "time"),
-    ("time", "localtime"),
-    ("random", "random"),
-    ("random", "randint"),
-    ("random", "choice"),
-    ("random", "uniform"),
-    ("uuid", "uuid4"),
-    ("uuid", "uuid1"),
-    ("pendulum", "now"),
-    ("pendulum", "today"),
-    ("pendulum", "yesterday"),
-    ("pendulum", "tomorrow"),
-]
+RUNTIME_VARYING_CALLS: frozenset[tuple[str, str]] = frozenset(
+    {
+        ("datetime", "now"),
+        ("datetime", "today"),
+        ("datetime", "utcnow"),
+        ("date", "today"),
+        ("time", "time"),
+        ("time", "localtime"),
+        ("random", "random"),
+        ("random", "randint"),
+        ("random", "choice"),
+        ("random", "uniform"),
+        ("uuid", "uuid4"),
+        ("uuid", "uuid1"),
+        ("pendulum", "now"),
+        ("pendulum", "today"),
+        ("pendulum", "yesterday"),
+        ("pendulum", "tomorrow"),
+    }
+)
 
 
 class DagVersionInflationCheckLevel(Enum):