Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
92b760a
feat: AIP-90 PoC
Lee-W Jun 13, 2025
79752b9
feat(hitl): move hitl execution api to core
Lee-W Jul 4, 2025
e356520
feat(hitl): move models
Lee-W Jul 4, 2025
633b74b
feat(hitl): move core_api from provider to core
Lee-W Jul 4, 2025
c6fd458
feat(hitl): add migration files
Lee-W Jul 4, 2025
78cbc3c
fix: fix ci issue
Lee-W Jul 4, 2025
cae9039
build: rebuild frontend
Lee-W Jul 5, 2025
ae41a3a
fix(hitl): generate datamodel
Lee-W Jul 5, 2025
48e0eeb
fix(hitl): add HITL module to models
Lee-W Jul 5, 2025
939d288
feat(hitl): add multiple support
Lee-W Jul 7, 2025
c75afe4
test(hitl): improve supervisor.handle_request
Lee-W Jul 7, 2025
2d57bce
test(hitl): add execution_time test cases
Lee-W Jul 7, 2025
c70d69d
test(hitl): add test cases to public api
Lee-W Jul 8, 2025
21cd2fb
refactor(hitl): replace ImportError with AirflowOptionalProviderFeatu…
Lee-W Jul 8, 2025
2a758f2
refactor(hitl): remove unnecessay directories
Lee-W Jul 8, 2025
8c2a59f
test(hitl): add test cases to execution api
Lee-W Jul 8, 2025
4e5696a
test(hitl): add test cases to operators
Lee-W Jul 8, 2025
63f850c
style: fix mypy warning
Lee-W Jul 8, 2025
b06e181
ci: fix ci errors
Lee-W Jul 8, 2025
ed04ffa
feat(hitl): add fk constraint
Lee-W Jul 9, 2025
fcd7c3d
feat(hitl): set params as ParamsDict
Lee-W Jul 9, 2025
8ef4cd9
docs(hitl_operator): update body description
Lee-W Jul 9, 2025
a0b30f8
feat(hitl): rename hitl-responses as hitl-details
Lee-W Jul 9, 2025
2144114
feat(hitl): rename response_content as chosen_options
Lee-W Jul 9, 2025
63978db
feat(hitl): rename default as defaults
Lee-W Jul 9, 2025
37ff01c
feat(hitl): rewrite public api to fit frontend's need
Lee-W Jul 9, 2025
22b23c5
style(hitl): improve test typing
Lee-W Jul 9, 2025
c5fe122
test(hitl): add mapped test cases
Lee-W Jul 9, 2025
570350d
feat(hitl): merge termination operator into approval operators
Lee-W Jul 10, 2025
43ab982
feat(hitl): allow timeout without default
Lee-W Jul 10, 2025
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
2 changes: 1 addition & 1 deletion airflow-core/docs/img/airflow_erd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e0de73aab81a28995b99be21dd25c8ca31c4e0f4a5a0a26df8aff412e5067fd5
2e49ab99fe1076b0f3f22a52b9ee37eeb7fc20a5a043ea504cc26022f4315277
812 changes: 437 additions & 375 deletions airflow-core/docs/img/airflow_erd.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion airflow-core/docs/migrations-ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ Here's the list of all the Database Migrations that are executed via when you ru
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| Revision ID | Revises ID | Airflow Version | Description |
+=========================+==================+===================+==============================================================+
| ``5d3072c51bac`` (head) | ``ffdb0566c7c0`` | ``3.1.0`` | Make dag_version_id non-nullable in TaskInstance. |
| ``40f7c30a228b`` (head) | ``5d3072c51bac`` | ``3.1.0`` | Add Human In the Loop Detail table. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| ``5d3072c51bac`` | ``ffdb0566c7c0`` | ``3.1.0`` | Make dag_version_id non-nullable in TaskInstance. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| ``ffdb0566c7c0`` | ``66a7743fe20e`` | ``3.1.0`` | Add dag_favorite table. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from __future__ import annotations

from collections.abc import Mapping
from datetime import datetime
from typing import Any

from pydantic import Field, field_validator

from airflow.api_fastapi.core_api.base import BaseModel
from airflow.sdk import Param


class UpdateHITLDetailPayload(BaseModel):
"""Schema for updating the content of a Human-in-the-loop detail."""

chosen_options: list[str]
params_input: Mapping = Field(default_factory=dict)


class HITLDetailResponse(BaseModel):
"""Response of updating a Human-in-the-loop detail."""

user_id: str
response_at: datetime
chosen_options: list[str]
params_input: Mapping = Field(default_factory=dict)


class HITLDetail(BaseModel):
"""Schema for Human-in-the-loop detail."""

ti_id: str

# User Request Detail
options: list[str]
subject: str
body: str | None = None
defaults: list[str] | None = None
multiple: bool = False
params: dict[str, Any] = Field(default_factory=dict)

# Response Content Detail
user_id: str | None = None
response_at: datetime | None = None
chosen_options: list[str] | None = None
params_input: dict[str, Any] = Field(default_factory=dict)

response_received: bool = False

@field_validator("params", mode="before")
@classmethod
def get_params(cls, params: dict[str, Any]) -> dict[str, Any]:
"""Convert params attribute to dict representation."""
return {k: v.dump() if isinstance(v, Param) else v for k, v in params.items()}


class HITLDetailCollection(BaseModel):
"""Schema for a collection of Human-in-the-loop details."""

hitl_details: list[HITLDetail]
total_entries: int
Loading