Skip to content
Closed
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
6 changes: 6 additions & 0 deletions airflow-core/src/airflow/cli/commands/connection_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,15 @@ def connections_test(args) -> None:
raise SystemExit(1)

print(f"Retrieving connection: {args.conn_id!r}")
conn = None
try:
conn = Connection.get_connection_from_secrets(args.conn_id)
except AirflowNotFoundException:
pass
if conn is None:
with create_session() as session:
conn = session.scalar(select(Connection).where(Connection.conn_id == args.conn_id))
if conn is None:
console.print("[bold yellow]\nConnection not found.\n")
raise SystemExit(1)

Expand Down