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
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def update_hitl_detail(
f"Human-in-the-loop detail for Task Instance with id {ti_id_str} already exists.",
)

hitl_detail_model.responded_by = HITLDetail.DEFAULT_USER
hitl_detail_model.responded_by = None
hitl_detail_model.response_at = datetime.now(timezone.utc)
hitl_detail_model.chosen_options = payload.chosen_options
hitl_detail_model.params_input = payload.params_input
Expand Down
5 changes: 0 additions & 5 deletions airflow-core/src/airflow/models/hitl.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,3 @@ def responded_by_user(self) -> HITLUser | None:
id=self.responded_by["id"],
name=self.responded_by["name"],
)

DEFAULT_USER = HITLUser(
id="Fallback to defaults",
name="Fallback to defaults",
)
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def expected_sample_hitl_detail_dict(sample_ti: TaskInstance) -> dict[str, Any]:
"params_input": {"input_1": 2},
"response_at": convert_to_utc(datetime(2025, 7, 3, 0, 0, 0)),
"chosen_options": ["Reject"],
"responded_by": {"id": "Fallback to defaults", "name": "Fallback to defaults"},
"responded_by": None,
},
},
],
Expand Down Expand Up @@ -174,10 +174,7 @@ def test_update_hitl_detail(client: Client, sample_ti: TaskInstance) -> None:
"response_at": "2025-07-03T00:00:00Z",
"chosen_options": ["Reject"],
"response_received": True,
"responded_by_user": {
"id": "Fallback to defaults",
"name": "Fallback to defaults",
},
"responded_by_user": None,
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class HITLTriggerEventSuccessPayload(TypedDict, total=False):

chosen_options: list[str]
params_input: dict[str, Any]
responded_by_user: HITLUser
responded_by_user: HITLUser | None
timedout: bool


Expand Down Expand Up @@ -148,10 +148,7 @@ async def run(self) -> AsyncIterator[TriggerEvent]:
HITLTriggerEventSuccessPayload(
chosen_options=self.defaults,
params_input=self.params,
responded_by_user=HITLUser(
id="Fallback to defaults",
name="Fallback to defaults",
),
responded_by_user=None,
timedout=True,
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async def test_run_fallback_to_default_due_to_timeout(self, mock_update, mock_lo
HITLTriggerEventSuccessPayload(
chosen_options=["1"],
params_input={"input": 1},
responded_by_user={"id": "Fallback to defaults", "name": "Fallback to defaults"},
responded_by_user=None,
timedout=True,
)
)
Expand Down