Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion airflow-core/src/airflow/jobs/triggerer_job_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ def _handle_request(self, msg: ToTriggerSupervisor, log: FilteringBoundLogger, r
if isinstance(conn, ConnectionResponse):
conn_result = ConnectionResult.from_conn_response(conn)
resp = conn_result
dump_opts = {"exclude_unset": True}
# `by_alias=True` is used to convert the `schema` field to `schema_` in the Connection model
dump_opts = {"exclude_unset": True, "by_alias": True}
else:
resp = conn
elif isinstance(msg, GetVariable):
Expand Down
23 changes: 16 additions & 7 deletions airflow-core/tests/unit/jobs/test_triggerer_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,16 @@ async def test_trigger_can_access_variables_connections_and_xcoms(session, dag_m
task_instance.trigger_id = trigger_orm.id

# Create the appropriate Connection, Variable and XCom
connection = Connection(conn_id="test_connection", conn_type="http")
connection = Connection(
conn_id="test_connection",
conn_type="http",
schema="https",
login="user",
password="pass",
extra={"key": "value"},
port=443,
host="example.com",
)
variable = Variable(key="test_variable", val="some_variable_value")
XComModel.set(
key="test_xcom",
Expand Down Expand Up @@ -675,12 +684,12 @@ async def test_trigger_can_access_variables_connections_and_xcoms(session, dag_m
"conn_id": "test_connection",
"conn_type": "http",
"description": None,
"host": None,
"schema": None,
"login": None,
"password": None,
"port": None,
"extra": None,
"host": "example.com",
"schema": "https",
"login": "user",
"password": "pass",
"port": 443,
"extra": '{"key": "value"}',
},
"variable": "some_variable_value",
"xcom": '"some_xcom_value"',
Expand Down