From 3829d6e5959144367a30dc7127e750d540812019 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Wed, 22 Jul 2026 12:16:47 +0800 Subject: [PATCH] Fix stale conn-id fallback assertion for cloudwatch remote logging Provider dispatch (added for cloudwatch in #69816) intentionally drops the hook's default_conn_name fallback, so an unset remote_log_conn_id no longer resolves to aws_default. test_remote_logging_conn's no-conn-id case expected the old fallback and failed on main; update it to expect no connection env var. --- task-sdk/tests/task_sdk/execution_time/test_supervisor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/task-sdk/tests/task_sdk/execution_time/test_supervisor.py b/task-sdk/tests/task_sdk/execution_time/test_supervisor.py index c39ceb92b0e3b..7ba463567a17a 100644 --- a/task-sdk/tests/task_sdk/execution_time/test_supervisor.py +++ b/task-sdk/tests/task_sdk/execution_time/test_supervisor.py @@ -3647,7 +3647,7 @@ def noop_handler(request: httpx.Request) -> httpx.Response: @pytest.mark.parametrize( ("remote_logging", "remote_conn", "expected_env"), ( - pytest.param(True, "", "AIRFLOW_CONN_AWS_DEFAULT", id="no-conn-id"), + pytest.param(True, "", "", id="no-conn-id"), pytest.param(True, "aws_default", "AIRFLOW_CONN_AWS_DEFAULT", id="explicit-default"), pytest.param(True, "my_aws", "AIRFLOW_CONN_MY_AWS", id="other"), pytest.param(False, "", "", id="no-remote-logging"), @@ -3698,7 +3698,7 @@ def handle_request(request: httpx.Request) -> httpx.Response: with _remote_logging_conn(client): new_keys = os.environ.keys() - env.keys() - if remote_logging: + if remote_logging and expected_env: # _remote_logging_conn sets both the connection env var and _AIRFLOW_PROCESS_CONTEXT assert new_keys == {expected_env, "_AIRFLOW_PROCESS_CONTEXT"} else: