Repository navigation
Description
Under which category would you file this issue?
Airflow Core
Apache Airflow version
3.4.0
What happened and how to reproduce it?
On Python 3.14, every airflow CLI command, even airflow version, prints two PendingDeprecationWarnings before its own output:
2026-11-30T18:20:58.731732Z [warning ] FileType is deprecated. Simply open files after parsing arguments. [py.warnings] category=PendingDeprecationWarning filename=.../site-packages/airflow/cli/cli_config.py lineno=662
2026-11-30T18:20:58.732116Z [warning ] FileType is deprecated. Simply open files after parsing arguments. [py.warnings] category=PendingDeprecationWarning filename=.../site-packages/airflow/cli/cli_config.py lineno=889
3.4.0
Python 3.14 deprecated argparse.FileType ("Deprecated since version 3.14" in the argparse docs), and FileType.__init__ now calls warnings.warn("FileType is deprecated. Simply open files after parsing arguments.", category=PendingDeprecationWarning, stacklevel=2).
airflow/cli/cli_config.py creates two argparse.FileType("w", encoding="UTF-8") objects at import time: ARG_VAR_EXPORT (airflow variables export) and ARG_CONN_EXPORT (airflow connections export). The module is imported for every command, so the warning is raised every time. Because of stacklevel=2 the warning is attributed to airflow.cli.cli_config, and the filter that airflow/configuration.py adds for PendingDeprecationWarning in airflow modules makes it visible.
Both are still on main:
type=argparse.FileType("w", encoding="UTF-8"), type=argparse.FileType("w", encoding="UTF-8"), warnings.filterwarnings(action="default", category=PendingDeprecationWarning, module="airflow")
Steps to reproduce (the uv route from the Quick Start, Python 3.14.10, uv 0.13.10):
uv venv --python 3.14
source .venv/bin/activate
uv pip install "apache-airflow==3.4.0" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-3.4.0/constraints-3.14.txt"
airflow versionWhat you think should happen instead?
No warning. A command that doesn't export anything shouldn't warn about file arguments it never uses. On 3.14 the same two lines come before the output of every command: airflow config get-value api port, for example, prints them too.
Python's docs suggest waiting "until after the parser has run" and opening the file with a with statement. The two arguments could take a path (type=str), with variables export and connections export opening the file themselves.
Operating System
macOS 26.7.4 (arm64)
Deployment
Virtualenv installation
Apache Airflow Provider(s)
No response
Versions of Apache Airflow Providers
Not relevant: the warning comes from airflow-core's CLI. The constraints install above brings apache-airflow-providers-common-compat 1.23.0, common-io 1.11.0, common-sql 2.4.0, smtp 3.2.0 and standard 1.21.0.
Official Helm Chart version
Not Applicable
Kubernetes Version
Not Applicable
Helm Chart configuration
Not Applicable
Docker Image customizations
Not Applicable
Anything else?
It happens every time on Python 3.14. The two lines above are the complete output of airflow version apart from 3.4.0 itself.
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
boring-cyborg commentedon Nov 30, 2026
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
codewithsanjay-pixel commentedon Dec 1, 2026
I'd like to work on this. Will submit a PR shortly.