This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new 58a4ee2ae00 [v3-1-test] fix(cli): Set server context for connections
(#59624) (#59652)
58a4ee2ae00 is described below
commit 58a4ee2ae00fde22883147561765ae0e3a068b01
Author: Jarek Potiuk <[email protected]>
AuthorDate: Fri Dec 19 19:33:12 2025 +0100
[v3-1-test] fix(cli): Set server context for connections (#59624) (#59652)
(cherry picked from commit caa81a74c381658ebdbe264aaaea7a6bedea953e)
Co-authored-by: Yeonguk Choo <[email protected]>
---
airflow-core/src/airflow/cli/commands/connection_command.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/airflow-core/src/airflow/cli/commands/connection_command.py
b/airflow-core/src/airflow/cli/commands/connection_command.py
index 7fe430c05bf..6cf4378c42a 100644
--- a/airflow-core/src/airflow/cli/commands/connection_command.py
+++ b/airflow-core/src/airflow/cli/commands/connection_command.py
@@ -65,6 +65,8 @@ def _connection_mapper(conn: Connection) -> dict[str, Any]:
@providers_configuration_loaded
def connections_get(args):
"""Get a connection."""
+ os.environ["_AIRFLOW_PROCESS_CONTEXT"] = "server"
+
try:
conn = Connection.get_connection_from_secrets(args.conn_id)
except AirflowNotFoundException:
@@ -358,6 +360,8 @@ def _import_helper(file_path: str, overwrite: bool) -> None:
@providers_configuration_loaded
def connections_test(args) -> None:
"""Test an Airflow connection."""
+ os.environ["_AIRFLOW_PROCESS_CONTEXT"] = "server"
+
console = AirflowConsole()
if conf.get("core", "test_connection",
fallback="Disabled").lower().strip() != "enabled":
console.print(