Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions airflow-core/src/airflow/cli/commands/connection_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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(
Expand Down