From 5c092b76251fb86dc1262b14480a3eca7e5d8872 Mon Sep 17 00:00:00 2001 From: GUAN MING Date: Wed, 20 Aug 2025 00:09:19 +0800 Subject: [PATCH] Fix typos in HITL-related code and comments --- .../standard/src/airflow/providers/standard/exceptions.py | 2 +- .../src/airflow/providers/standard/triggers/hitl.py | 4 ++-- .../standard/tests/unit/standard/triggers/test_hitl.py | 6 +++--- task-sdk/src/airflow/sdk/execution_time/hitl.py | 2 +- task-sdk/tests/task_sdk/execution_time/test_hitl.py | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/providers/standard/src/airflow/providers/standard/exceptions.py b/providers/standard/src/airflow/providers/standard/exceptions.py index 6975e0afadfb3..f47e9f3896ffb 100644 --- a/providers/standard/src/airflow/providers/standard/exceptions.py +++ b/providers/standard/src/airflow/providers/standard/exceptions.py @@ -62,4 +62,4 @@ class HITLTriggerEventError(AirflowException): class HITLTimeoutError(HITLTriggerEventError): - """Raised when HILTOperator timeouts.""" + """Raised when HITLOperator timeouts.""" diff --git a/providers/standard/src/airflow/providers/standard/triggers/hitl.py b/providers/standard/src/airflow/providers/standard/triggers/hitl.py index e65e683b8ff93..82ee829ac8321 100644 --- a/providers/standard/src/airflow/providers/standard/triggers/hitl.py +++ b/providers/standard/src/airflow/providers/standard/triggers/hitl.py @@ -32,7 +32,7 @@ from airflow.sdk.execution_time.hitl import ( get_hitl_detail_content_detail, - update_htil_detail_response, + update_hitl_detail_response, ) from airflow.sdk.timezone import utcnow from airflow.triggers.base import BaseTrigger, TriggerEvent @@ -107,7 +107,7 @@ async def run(self) -> AsyncIterator[TriggerEvent]: ) return - await sync_to_async(update_htil_detail_response)( + await sync_to_async(update_hitl_detail_response)( ti_id=self.ti_id, chosen_options=self.defaults, params_input=self.params, diff --git a/providers/standard/tests/unit/standard/triggers/test_hitl.py b/providers/standard/tests/unit/standard/triggers/test_hitl.py index ad363a8f5b84e..fe7900d3fbdf9 100644 --- a/providers/standard/tests/unit/standard/triggers/test_hitl.py +++ b/providers/standard/tests/unit/standard/triggers/test_hitl.py @@ -70,7 +70,7 @@ def test_serialization(self): @pytest.mark.db_test @pytest.mark.asyncio - @mock.patch("airflow.sdk.execution_time.hitl.update_htil_detail_response") + @mock.patch("airflow.sdk.execution_time.hitl.update_hitl_detail_response") async def test_run_failed_due_to_timeout(self, mock_update, mock_supervisor_comms): trigger = HITLTrigger( timeout_datetime=utcnow() + timedelta(seconds=0.1), @@ -99,7 +99,7 @@ async def test_run_failed_due_to_timeout(self, mock_update, mock_supervisor_comm @pytest.mark.db_test @pytest.mark.asyncio @mock.patch.object(HITLTrigger, "log") - @mock.patch("airflow.sdk.execution_time.hitl.update_htil_detail_response") + @mock.patch("airflow.sdk.execution_time.hitl.update_hitl_detail_response") async def test_run_fallback_to_default_due_to_timeout(self, mock_update, mock_log, mock_supervisor_comms): trigger = HITLTrigger( defaults=["1"], @@ -131,7 +131,7 @@ async def test_run_fallback_to_default_due_to_timeout(self, mock_update, mock_lo @pytest.mark.db_test @pytest.mark.asyncio @mock.patch.object(HITLTrigger, "log") - @mock.patch("airflow.sdk.execution_time.hitl.update_htil_detail_response") + @mock.patch("airflow.sdk.execution_time.hitl.update_hitl_detail_response") async def test_run(self, mock_update, mock_log, mock_supervisor_comms, time_machine): time_machine.move_to(datetime(2025, 7, 29, 2, 0, 0)) diff --git a/task-sdk/src/airflow/sdk/execution_time/hitl.py b/task-sdk/src/airflow/sdk/execution_time/hitl.py index 8c7d45e6242b2..500be78ab4e22 100644 --- a/task-sdk/src/airflow/sdk/execution_time/hitl.py +++ b/task-sdk/src/airflow/sdk/execution_time/hitl.py @@ -56,7 +56,7 @@ def upsert_hitl_detail( ) -def update_htil_detail_response( +def update_hitl_detail_response( ti_id: UUID, chosen_options: list[str], params_input: dict[str, Any], diff --git a/task-sdk/tests/task_sdk/execution_time/test_hitl.py b/task-sdk/tests/task_sdk/execution_time/test_hitl.py index a758507e1c887..5ad6733eb089f 100644 --- a/task-sdk/tests/task_sdk/execution_time/test_hitl.py +++ b/task-sdk/tests/task_sdk/execution_time/test_hitl.py @@ -24,7 +24,7 @@ from airflow.sdk.execution_time.comms import CreateHITLDetailPayload from airflow.sdk.execution_time.hitl import ( get_hitl_detail_content_detail, - update_htil_detail_response, + update_hitl_detail_response, upsert_hitl_detail, ) @@ -56,7 +56,7 @@ def test_upsert_hitl_detail(mock_supervisor_comms) -> None: ) -def test_update_htil_detail_response(mock_supervisor_comms) -> None: +def test_update_hitl_detail_response(mock_supervisor_comms) -> None: timestamp = timezone.utcnow() mock_supervisor_comms.send.return_value = HITLDetailResponse( response_received=True, @@ -65,7 +65,7 @@ def test_update_htil_detail_response(mock_supervisor_comms) -> None: user_id="admin", params_input={"input_1": 1}, ) - resp = update_htil_detail_response( + resp = update_hitl_detail_response( ti_id=TI_ID, chosen_options=["Approve"], params_input={"input_1": 1},