This is an automated email from the ASF dual-hosted git repository.
henry3260 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 d1587ae4af1 Remove the dead CFullLoader branch from the YAML helpers
(#70943)
d1587ae4af1 is described below
commit d1587ae4af1332328f6de0a293465265cabf76eb
Author: rjgoyln <[email protected]>
AuthorDate: Sun Sep 6 02:37:28 2026 +0800
Remove the dead CFullLoader branch from the YAML helpers (#70943)
These YAML wrappers are documented as a drop-in replacement for pyyaml,
and the branch meant to swap in libyaml's FullLoader has never taken
effect: it discarded the value it looked up.
Making it work is the wrong repair. CFullLoader is not a FullLoader
subclass, and yaml.add_constructor registers only on the pure-Python
loaders, so tags registered through the same wrapper would start raising
ConstructorError instead of resolving. That surface is reachable from Dag
code, since the Task SDK copy is re-exported as macros.yaml.
Keeping pyyaml's FullLoader is what callers already depend on; safe_load
and dump continue to use the C implementation, where Airflow controls
both ends.
---
airflow-core/src/airflow/utils/yaml.py | 6 ++----
airflow-ctl/src/airflowctl/ctl/utils/yaml.py | 6 ++----
task-sdk/src/airflow/sdk/yaml.py | 6 ++----
3 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/airflow-core/src/airflow/utils/yaml.py
b/airflow-core/src/airflow/utils/yaml.py
index 2bc5911d10d..a449ac943f6 100644
--- a/airflow-core/src/airflow/utils/yaml.py
+++ b/airflow-core/src/airflow/utils/yaml.py
@@ -66,8 +66,6 @@ def __getattr__(name):
# Delegate anything else to the yaml module
import yaml
- if name == "FullLoader":
- # Try to use CFullLoader by default
- getattr(yaml, "CFullLoader", yaml.FullLoader)
-
+ # FullLoader stays pyyaml's on purpose: CFullLoader does not see
add_constructor
+ # registrations, so custom tags would raise ConstructorError instead of
resolving.
return getattr(yaml, name)
diff --git a/airflow-ctl/src/airflowctl/ctl/utils/yaml.py
b/airflow-ctl/src/airflowctl/ctl/utils/yaml.py
index a52910f73ea..4c04b750ee0 100644
--- a/airflow-ctl/src/airflowctl/ctl/utils/yaml.py
+++ b/airflow-ctl/src/airflowctl/ctl/utils/yaml.py
@@ -67,8 +67,6 @@ def __getattr__(name):
# Delegate anything else to the yaml module
import yaml
- if name == "FullLoader":
- # Try to use CFullLoader by default
- getattr(yaml, "CFullLoader", yaml.FullLoader)
-
+ # FullLoader stays pyyaml's on purpose: CFullLoader does not see
add_constructor
+ # registrations, so custom tags would raise ConstructorError instead of
resolving.
return getattr(yaml, name)
diff --git a/task-sdk/src/airflow/sdk/yaml.py b/task-sdk/src/airflow/sdk/yaml.py
index 3be8d68f009..a854fa69bd2 100644
--- a/task-sdk/src/airflow/sdk/yaml.py
+++ b/task-sdk/src/airflow/sdk/yaml.py
@@ -66,8 +66,6 @@ def __getattr__(name):
# Delegate anything else to the yaml module
import yaml
- if name == "FullLoader":
- # Try to use CFullLoader by default
- getattr(yaml, "CFullLoader", yaml.FullLoader)
-
+ # FullLoader stays pyyaml's on purpose: CFullLoader does not see
add_constructor
+ # registrations, so custom tags would raise ConstructorError instead of
resolving.
return getattr(yaml, name)