You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2025/09/16 16:16:36 UTC
(airflow) branch v3-1-test updated (e5ff56cfd10 -> 083f6e25aae)
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a change to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
omit e5ff56cfd10 Dev: Fix another Python 3.13 compat for Prod image tests
new f300510e1cb Dev: Fix another Python 3.13 compat for Prod image tests (#55701)
new 1f7d297ef1d Upgrade prek to fix `invalid option: --no-pager` on CI failure (#55710)
new 672a39efa1f Fix error when retrieving logs of ti not run because of upstream failures (#55517)
new d91f7575a5d Add HITLDetail.created_at (#55525)
new 4f326422b03 Add SELinux/AppArmor note for creating airflow.cfg in Docker-compose stacks (#55662)
new 07768b174be Simplify serve_logs IPv4/v6 binding (#55716)
new 083f6e25aae Reduce default API server workers to 1 (#55707)
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (e5ff56cfd10)
\
N -- N -- N refs/heads/v3-1-test (083f6e25aae)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.github/actions/install-prek/action.yml | 2 +-
Dockerfile.ci | 2 +-
airflow-core/docs/howto/docker-compose/index.rst | 25 ++++-
airflow-core/docs/img/airflow_erd.sha256 | 2 +-
airflow-core/docs/img/airflow_erd.svg | 121 +++++++++++----------
airflow-core/newsfragments/55707.significant.rst | 23 ++++
.../api_fastapi/core_api/datamodels/hitl.py | 1 +
.../api_fastapi/core_api/openapi/_private_ui.yaml | 5 +
.../core_api/openapi/v2-rest-api-generated.yaml | 41 +++++++
.../api_fastapi/core_api/routes/public/hitl.py | 5 +
.../src/airflow/config_templates/config.yml | 6 +-
.../0076_3_1_0_add_human_in_the_loop_response.py | 2 +
airflow-core/src/airflow/models/hitl.py | 2 +
.../src/airflow/ui/openapi-gen/queries/common.ts | 8 +-
.../ui/openapi-gen/queries/ensureQueryData.ts | 12 +-
.../src/airflow/ui/openapi-gen/queries/prefetch.ts | 12 +-
.../src/airflow/ui/openapi-gen/queries/queries.ts | 12 +-
.../src/airflow/ui/openapi-gen/queries/suspense.ts | 12 +-
.../airflow/ui/openapi-gen/requests/schemas.gen.ts | 7 +-
.../ui/openapi-gen/requests/services.gen.ts | 10 +-
.../airflow/ui/openapi-gen/requests/types.gen.ts | 5 +
.../src/airflow/utils/log/file_task_handler.py | 5 +-
airflow-core/src/airflow/utils/serve_logs/core.py | 10 +-
.../core_api/routes/public/test_hitl.py | 34 +++++-
.../api_fastapi/core_api/routes/ui/test_dags.py | 1 +
airflow-core/tests/unit/utils/test_log_handlers.py | 25 +++--
.../src/airflowctl/api/datamodels/generated.py | 1 +
dev/breeze/README.md | 2 +-
dev/breeze/doc/ci/02_images.md | 2 +-
dev/breeze/pyproject.toml | 2 +-
.../commands/release_management_commands.py | 2 +-
dev/breeze/uv.lock | 46 ++++----
32 files changed, 316 insertions(+), 129 deletions(-)
create mode 100644 airflow-core/newsfragments/55707.significant.rst
(airflow) 05/07: Add SELinux/AppArmor note for creating airflow.cfg in Docker-compose stacks (#55662)
Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 4f326422b0315bb4344f8a8e0afd6d82e241698c
Author: Ken Lewerentz <kn...@gmail.com>
AuthorDate: Tue Sep 16 17:12:56 2025 +0700
Add SELinux/AppArmor note for creating airflow.cfg in Docker-compose stacks (#55662)
Co-authored-by: Ash Berlin-Taylor <as...@firemirror.com>
(cherry picked from commit 86cd11a62896b86d9e8f20a22990b440018b3a0b)
---
airflow-core/docs/howto/docker-compose/index.rst | 25 +++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/airflow-core/docs/howto/docker-compose/index.rst b/airflow-core/docs/howto/docker-compose/index.rst
index 7e6d15a9e67..c417950e733 100644
--- a/airflow-core/docs/howto/docker-compose/index.rst
+++ b/airflow-core/docs/howto/docker-compose/index.rst
@@ -154,6 +154,24 @@ If you want to initialize ``airflow.cfg`` with default values before launching t
This will seed ``airflow.cfg`` with default values in ``config`` folder.
+On systems with SELinux/AppArmor, you may run into permission issues. If this happens, edit your ``docker-compose.yaml`` file by added the suffix ``:z`` to all volumes:
+
+.. code-block:: yaml
+
+ volumes:
+ - ${AIRFLOW_PROJ_DIR:-.}/dags:/opt/airflow/dags:z
+ - ${AIRFLOW_PROJ_DIR:-.}/logs:/opt/airflow/logs:z
+ - ${AIRFLOW_PROJ_DIR:-.}/config:/opt/airflow/config:z
+ - ${AIRFLOW_PROJ_DIR:-.}/plugins:/opt/airflow/plugins:z
+
+If, after this change, you are still experiencing permission issues when creating the ``airflow.cfg`` file, you can apply a very permissive setting to the ``config/`` folder:
+
+.. code-block:: bash
+
+ sudo chmod -R 777 ./config
+
+Note that the above is a *work around* that should never be used in production.
+
Initialize the database
-----------------------
@@ -163,14 +181,11 @@ On **all operating systems**, you need to run database migrations and create the
docker compose up airflow-init
-After initialization is complete, you should see a message like this:
+After initialization is complete, you should see output related to files, folders, and plug-ins and finally a message like this:
.. parsed-literal::
- airflow-init_1 | Upgrades done
- airflow-init_1 | Admin user airflow created
- airflow-init_1 | |version|
- start_airflow-init_1 exited with code 0
+ airflow-init-1 exited with code 0
The account created has the login ``airflow`` and the password ``airflow``.
(airflow) 03/07: Fix error when retrieving logs of ti not run because of upstream failures (#55517)
Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 672a39efa1feb49336209e00ff2a7e64b0bd70fa
Author: Sebastián Ortega <se...@datadoghq.com>
AuthorDate: Tue Sep 16 11:03:07 2025 +0200
Fix error when retrieving logs of ti not run because of upstream failures (#55517)
* Fix TestFileTaskLogHandler tests
* Return placeholder message when requested the logs of tasks skipped because of upstream failures
(cherry picked from commit b069f1fdbf833488a8da885d62734258fc3a73eb)
---
.../src/airflow/utils/log/file_task_handler.py | 5 ++++-
airflow-core/tests/unit/utils/test_log_handlers.py | 25 +++++++++++-----------
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/airflow-core/src/airflow/utils/log/file_task_handler.py b/airflow-core/src/airflow/utils/log/file_task_handler.py
index 3669aae122b..9954688a41f 100644
--- a/airflow-core/src/airflow/utils/log/file_task_handler.py
+++ b/airflow-core/src/airflow/utils/log/file_task_handler.py
@@ -741,7 +741,10 @@ class FileTaskHandler(logging.Handler):
if try_number is None:
try_number = task_instance.try_number
- if try_number == 0 and task_instance.state == TaskInstanceState.SKIPPED:
+ if try_number == 0 and task_instance.state in (
+ TaskInstanceState.SKIPPED,
+ TaskInstanceState.UPSTREAM_FAILED,
+ ):
logs = [StructuredLogMessage(event="Task was skipped, no logs available.")]
return chain(logs), {"end_of_log": True}
diff --git a/airflow-core/tests/unit/utils/test_log_handlers.py b/airflow-core/tests/unit/utils/test_log_handlers.py
index b5d939d52e7..6d2caaa8a43 100644
--- a/airflow-core/tests/unit/utils/test_log_handlers.py
+++ b/airflow-core/tests/unit/utils/test_log_handlers.py
@@ -79,7 +79,7 @@ from tests_common.test_utils.file_task_handler import (
)
from tests_common.test_utils.markers import skip_if_force_lowest_dependencies_marker
-pytestmark = [pytest.mark.db_test, pytest.mark.xfail()]
+pytestmark = [pytest.mark.db_test]
DEFAULT_DATE = pendulum.datetime(2016, 1, 1)
TASK_LOGGER = "airflow.task"
@@ -156,7 +156,8 @@ class TestFileTaskLogHandler:
# Remove the generated tmp log file.
os.remove(log_filename)
- def test_file_task_handler_when_ti_is_skipped(self, dag_maker):
+ @pytest.mark.parametrize("ti_state", [TaskInstanceState.SKIPPED, TaskInstanceState.UPSTREAM_FAILED])
+ def test_file_task_handler_when_ti_is_not_run(self, dag_maker, ti_state):
def task_callable(ti):
ti.log.info("test")
@@ -170,10 +171,10 @@ class TestFileTaskLogHandler:
ti = TaskInstance(task=task, run_id=dagrun.run_id, dag_version_id=dag_version.id)
ti.try_number = 0
- ti.state = State.SKIPPED
+ ti.state = ti_state
- logger = ti.log
- ti.log.disabled = False
+ logger = logging.getLogger(TASK_LOGGER)
+ logger.disabled = False
file_handler = next(
(handler for handler in logger.handlers if handler.name == FILE_TASK_HANDLER), None
@@ -295,8 +296,8 @@ class TestFileTaskLogHandler:
ti.executor = executor_name
ti.try_number = 1
ti.state = TaskInstanceState.RUNNING
- logger = ti.log
- ti.log.disabled = False
+ logger = logging.getLogger(TASK_LOGGER)
+ logger.disabled = False
file_handler = next(
(handler for handler in logger.handlers if handler.name == FILE_TASK_HANDLER), None
@@ -344,8 +345,8 @@ class TestFileTaskLogHandler:
ti.try_number = 2
ti.state = State.RUNNING
- logger = ti.log
- ti.log.disabled = False
+ logger = logging.getLogger(TASK_LOGGER)
+ logger.disabled = False
file_handler = next(
(handler for handler in logger.handlers if handler.name == FILE_TASK_HANDLER), None
@@ -396,8 +397,8 @@ class TestFileTaskLogHandler:
ti.try_number = 1
ti.state = State.RUNNING
- logger = ti.log
- ti.log.disabled = False
+ logger = logging.getLogger(TASK_LOGGER)
+ logger.disabled = False
file_handler = next(
(handler for handler in logger.handlers if handler.name == FILE_TASK_HANDLER), None
@@ -413,7 +414,7 @@ class TestFileTaskLogHandler:
assert log_filename.endswith("1.log"), log_filename
# mock to generate 2000 lines of log, the total size is larger than max_bytes_size
- for i in range(1, 2000):
+ for i in range(1, 3000):
logger.info("this is a Test. %s", i)
# this is the rotate log file
(airflow) 02/07: Upgrade prek to fix `invalid option: --no-pager` on CI failure (#55710)
Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 1f7d297ef1d90e5f2841339a00126a4c5cf01c1b
Author: Ash Berlin-Taylor <as...@apache.org>
AuthorDate: Tue Sep 16 09:53:36 2025 +0100
Upgrade prek to fix `invalid option: --no-pager` on CI failure (#55710)
If the hooks made any changes, instead of seeing the git diff we would see
this error instead.
(cherry picked from commit 7d7991a2d8b4f172091e53e6cbac857f44db704a)
---
.github/actions/install-prek/action.yml | 2 +-
Dockerfile.ci | 2 +-
dev/breeze/README.md | 2 +-
dev/breeze/doc/ci/02_images.md | 2 +-
dev/breeze/pyproject.toml | 2 +-
.../commands/release_management_commands.py | 2 +-
dev/breeze/uv.lock | 46 +++++++++++-----------
7 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/.github/actions/install-prek/action.yml b/.github/actions/install-prek/action.yml
index 9289c000aaa..5926e0a60b0 100644
--- a/.github/actions/install-prek/action.yml
+++ b/.github/actions/install-prek/action.yml
@@ -27,7 +27,7 @@ inputs:
default: "0.8.17" # Keep this comment to allow automatic replacement of uv version
prek-version:
description: 'prek version to use'
- default: "0.2.0" # Keep this comment to allow automatic replacement of prek version
+ default: "0.2.1" # Keep this comment to allow automatic replacement of prek version
skip-prek-hooks:
description: "Skip some prek hooks from installation"
default: ""
diff --git a/Dockerfile.ci b/Dockerfile.ci
index a9e8d05bec7..7a359b344b4 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -1656,7 +1656,7 @@ COPY --from=scripts common.sh install_packaging_tools.sh install_additional_depe
ARG AIRFLOW_PIP_VERSION=25.2
# ARG AIRFLOW_PIP_VERSION="git+https://github.com/pypa/pip.git@main"
ARG AIRFLOW_UV_VERSION=0.8.17
-ARG AIRFLOW_PREK_VERSION="0.2.0"
+ARG AIRFLOW_PREK_VERSION="0.2.1"
# UV_LINK_MODE=copy is needed since we are using cache mounted from the host
ENV AIRFLOW_PIP_VERSION=${AIRFLOW_PIP_VERSION} \
diff --git a/dev/breeze/README.md b/dev/breeze/README.md
index 1972ba120e6..dd09eb72316 100644
--- a/dev/breeze/README.md
+++ b/dev/breeze/README.md
@@ -135,6 +135,6 @@ PLEASE DO NOT MODIFY THE HASH BELOW! IT IS AUTOMATICALLY UPDATED BY PREK.
---------------------------------------------------------------------------------------------------------
-Package config hash: 69dbe16e1e5cd15584658d419c1d2b5605ebeb0d264acc525563a23aaeea82ed15dd61b2ce292a1bec408cae112378960b39f6ee4aa0b1341e35d2ca6ad47351
+Package config hash: 5640b626a3ee4d7e1cb1ed176546ea890a4a57f5456e5cf84b840f782cace8449b42b0071498ece2dac865c543c5d05cb6976ac34e7c8a65bc07949103eab607
---------------------------------------------------------------------------------------------------------
diff --git a/dev/breeze/doc/ci/02_images.md b/dev/breeze/doc/ci/02_images.md
index 208fe14699e..cb05c2a1956 100644
--- a/dev/breeze/doc/ci/02_images.md
+++ b/dev/breeze/doc/ci/02_images.md
@@ -444,7 +444,7 @@ can be used for CI images:
| `ADDITIONAL_DEV_APT_ENV` | | Additional env variables defined when installing dev deps |
| `AIRFLOW_PIP_VERSION` | `25.2` | `pip` version used. |
| `AIRFLOW_UV_VERSION` | `0.8.17` | `uv` version used. |
-| `AIRFLOW_PREK_VERSION` | `0.2.0` | `prek` version used. |
+| `AIRFLOW_PREK_VERSION` | `0.2.1` | `prek` version used. |
| `AIRFLOW_USE_UV` | `true` | Whether to use UV for installation. |
| `PIP_PROGRESS_BAR` | `on` | Progress bar for PIP installation |
diff --git a/dev/breeze/pyproject.toml b/dev/breeze/pyproject.toml
index 82a65725b67..2d84b2d04e4 100644
--- a/dev/breeze/pyproject.toml
+++ b/dev/breeze/pyproject.toml
@@ -60,7 +60,7 @@ dependencies = [
"jinja2>=3.1.5",
"jsonschema>=4.19.1",
"packaging>=25.0",
- "prek>=0.2.0",
+ "prek>=0.2.1",
"psutil>=5.9.6",
"pygithub>=2.1.1",
"pytest-xdist>=3.3.1",
diff --git a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
index d1330fa57f4..088d6ea38c3 100644
--- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
@@ -257,7 +257,7 @@ AIRFLOW_UV_VERSION = "0.8.17"
AIRFLOW_USE_UV = False
GITPYTHON_VERSION = "3.1.45"
RICH_VERSION = "14.1.0"
-PREK_VERSION = "0.2.0"
+PREK_VERSION = "0.2.1"
HATCH_VERSION = "1.14.1"
PYYAML_VERSION = "6.0.2"
diff --git a/dev/breeze/uv.lock b/dev/breeze/uv.lock
index 580132093fb..604d4da7364 100644
--- a/dev/breeze/uv.lock
+++ b/dev/breeze/uv.lock
@@ -75,7 +75,7 @@ requires-dist = [
{ name = "jinja2", specifier = ">=3.1.5" },
{ name = "jsonschema", specifier = ">=4.19.1" },
{ name = "packaging", specifier = ">=25.0" },
- { name = "prek", specifier = ">=0.2.0" },
+ { name = "prek", specifier = ">=0.2.1" },
{ name = "psutil", specifier = ">=5.9.6" },
{ name = "pygithub", specifier = ">=2.1.1" },
{ name = "pytest", specifier = ">=8.3.3" },
@@ -1023,28 +1023,28 @@ wheels = [
[[package]]
name = "prek"
-version = "0.2.0"
-source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/dc/35/2f5d0844e336af23a7705f448f864c168070bfddb725d4a9f70e6feb9a8b/prek-0.2.0.tar.gz", hash = "sha256:4c5c73751fccb8186d54fd24544b45c8ee6197e83728dda55ef48d1895728f27", size = 3111203, upload-time = "2025-09-14T04:52:46.99Z" }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/1f/46/f341dcf9f913749584db3524c1362c17ee5f45ad9e82099073596c40f09c/prek-0.2.0-py3-none-linux_armv6l.whl", hash = "sha256:119e1c95cef1565b7f3c65ccec6d0348fbd5565d9583c488722df3306bc178b6", size = 4314951, upload-time = "2025-09-14T04:52:20.444Z" },
- { url = "https://files.pythonhosted.org/packages/3c/78/9b4703fda6b888ee189f56dfdfcb6b2677865d67133b963157bed0aad323/prek-0.2.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:d5d9881b9ac156e98db7958b3a4b21e992418df21e4cd9db755f95918d41a83e", size = 4427511, upload-time = "2025-09-14T04:52:22.374Z" },
- { url = "https://files.pythonhosted.org/packages/9e/32/2ff248f35150555d9ecceb035cca25173b12ea3b9e92d0f8a8ebc863bfd3/prek-0.2.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:ac300c62ad6dd20db912aaf39576a6e36ebd617dd61a9efd2012ae2ae75955ed", size = 4130931, upload-time = "2025-09-14T04:52:23.706Z" },
- { url = "https://files.pythonhosted.org/packages/5e/7b/ce435ab6c10457bda3a81588c5429ce4970df483218925cfec88cc469fb3/prek-0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:f212ce156ee26197cbe314685196b6e1d1d45714e871d682667804b7d295eaa6", size = 4293307, upload-time = "2025-09-14T04:52:25.324Z" },
- { url = "https://files.pythonhosted.org/packages/82/f3/236397a2bccce1243eae1ce2cf44eaac5b0de275f77c6efb6e26ad97c76b/prek-0.2.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:97ea5f16ea008653efebbe6cef2b5057d1cb6b94cde6543038ba382b7cc887ee", size = 4248950, upload-time = "2025-09-14T04:52:26.944Z" },
- { url = "https://files.pythonhosted.org/packages/e8/bb/f8d6a1f9f24740e65a183f15158b51c2d1a3ddc1680e8d52aeb83c6c895f/prek-0.2.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0db65bf7f3bca5d51930918ef376b7dffa328dd5545745e544821a7cf9e6752d", size = 4548363, upload-time = "2025-09-14T04:52:28.56Z" },
- { url = "https://files.pythonhosted.org/packages/36/5a/6a10eecb5b53136bec2fd07ffef2d021076e0f0a4199810abb6dc3e44d86/prek-0.2.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:67772d94e3d5ba56b300294ea7f2081a4f9f795f78d2c0d90b2ed0f822e0a085", size = 4970950, upload-time = "2025-09-14T04:52:30.274Z" },
- { url = "https://files.pythonhosted.org/packages/0a/88/63ed4ff105af5f7f2e6ff7b001ce66a309acc5fcd63c96eaf86850d5fdca/prek-0.2.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f4e639e543911cc2c0369d0ad7717ef19d721838fb6c06f9fcf2bafdefeef7a4", size = 4903426, upload-time = "2025-09-14T04:52:31.876Z" },
- { url = "https://files.pythonhosted.org/packages/04/d2/d727ae4260ee51dad9d09d8c2accd4b470785425fe2ab9d49410b70239f9/prek-0.2.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:acd34181168132f96dce2861bcddca202413a9174c94f8ad6e5aa64edcebcd34", size = 5026416, upload-time = "2025-09-14T04:52:33.494Z" },
- { url = "https://files.pythonhosted.org/packages/33/1c/c5bdf4d8c7e5f0c459517901171b685dff35c848e52fbbb49d1e08f27ce8/prek-0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d4fcd17367d289413b32aa72d8bb45959e9e3a3078e0770cc0f887ead51d203", size = 4637846, upload-time = "2025-09-14T04:52:34.986Z" },
- { url = "https://files.pythonhosted.org/packages/22/61/6801655fe64b278c4d96fffde4375502fdd66f047b42d3f59d3843fd871a/prek-0.2.0-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:98bbaa51ad5d1e8433538a22b4fa1905dc9b728a78866f0624bf7f3f7eb8ddbd", size = 4329890, upload-time = "2025-09-14T04:52:36.529Z" },
- { url = "https://files.pythonhosted.org/packages/ed/6d/76ad8d2f50c7990e8e60a5fdc7502e946f273d9beaa0d6000a314a842c38/prek-0.2.0-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:6b53c333b69c3636b950f0604b5dd22fd39b564c98a9ad0018740ecae26ffc0e", size = 4418015, upload-time = "2025-09-14T04:52:37.711Z" },
- { url = "https://files.pythonhosted.org/packages/3d/e7/096d243dd5a8d7c085afde6a58158cfb587e4a5a3e475549e5d3eb8a57a8/prek-0.2.0-py3-none-musllinux_1_1_armv7l.whl", hash = "sha256:e27f8fd1bc2238f6851506cf2d21cfb518eb9fc931f4f6ddf5c902d6c101fa90", size = 4225337, upload-time = "2025-09-14T04:52:39.042Z" },
- { url = "https://files.pythonhosted.org/packages/8a/2a/8981fa44aeba53b48ec326177f595c3a5d6805d069dcd01a1cb599579cb3/prek-0.2.0-py3-none-musllinux_1_1_i686.whl", hash = "sha256:e423a429e0e322df4386acd48f3a2287668f36c67b6494994633f894d07cf0b7", size = 4444904, upload-time = "2025-09-14T04:52:40.261Z" },
- { url = "https://files.pythonhosted.org/packages/a1/78/2d0ed02efce886b47add02899ce4e2ff6b1482e9b0388864ba4ed8dd3805/prek-0.2.0-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:a91055853dd87739e720b18d9a67557abde87dfd649220635631e38f713ccb37", size = 4710850, upload-time = "2025-09-14T04:52:41.451Z" },
- { url = "https://files.pythonhosted.org/packages/ec/b6/3c1973991259026df92e1278a0a1f681de277b55af520b86ade752b6ea61/prek-0.2.0-py3-none-win32.whl", hash = "sha256:9b5e1c08b2e4fff61cc32620cf09774e9bffcd3c36af19342459208d3de975ac", size = 4159872, upload-time = "2025-09-14T04:52:43.073Z" },
- { url = "https://files.pythonhosted.org/packages/dc/da/8f02c08ea7c03be325a4a25911c4856b04465195590747a72c905e16ce85/prek-0.2.0-py3-none-win_amd64.whl", hash = "sha256:0ef9f406e5a54cb1eac4e02b1f18bb16390dd1cafc38a56a8abc54556df900ab", size = 4711819, upload-time = "2025-09-14T04:52:44.42Z" },
- { url = "https://files.pythonhosted.org/packages/ea/69/c49d98bffdd1f05ae5dffda2db0cb921ecca2212a7d9bb02103f6de197b3/prek-0.2.0-py3-none-win_arm64.whl", hash = "sha256:6b718f11591d7e7a22c4679dc62854cc4f66d7e1f7814cb53e84e72d449f1c0f", size = 4408367, upload-time = "2025-09-14T04:52:45.832Z" },
+version = "0.2.1"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/93/0a/b2dabb829aebc4f98a10b8f5fac0e6ca4746463d5183622457e5727f5705/prek-0.2.1.tar.gz", hash = "sha256:60543afbf72ad9ce27a5fc4301179f75f473dc4cc221ff53b2bad18ff6eac998", size = 2919831, upload-time = "2025-09-15T15:14:23.382Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/50/f2/17fdccf51bef753a2ef50e936363779ff20a528ae4e197d9c9e84be5bc53/prek-0.2.1-py3-none-linux_armv6l.whl", hash = "sha256:bdd0e71ab6a63a9b81c268539ec249bfe1cd2b50fc39823727b256b0ba67d342", size = 4320246, upload-time = "2025-09-15T15:13:54.103Z" },
+ { url = "https://files.pythonhosted.org/packages/5e/fe/9a3b119ef905c8c52c17cfce1a4230d8f2f9ddfe6c0815ae52b7d616a038/prek-0.2.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:99c1611aea27c75cb76d23f7ca68440478b4372b2184e4c383af06a3ea9e8b8e", size = 4433105, upload-time = "2025-09-15T15:13:55.678Z" },
+ { url = "https://files.pythonhosted.org/packages/eb/93/a3cdfcd934dd2e661a2012efbed0e5ae8b2889ef313bd42f811826b5d259/prek-0.2.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:46ec9a2dc2f536ddc3381f9bc9461afbb48b767fe0159687b9a8302a0d910f9c", size = 4135455, upload-time = "2025-09-15T15:13:57.118Z" },
+ { url = "https://files.pythonhosted.org/packages/5d/d8/458d5dabe5b8671bd6054f46d8952f07b69be755d98370dc3fe80c797087/prek-0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:dd97d0f8d9ec3f1749d3b1c8c3310d2d946976d1ad58e54b1dce3e177b09cbb7", size = 4301081, upload-time = "2025-09-15T15:13:58.528Z" },
+ { url = "https://files.pythonhosted.org/packages/e3/32/100086408852c008e0b5e44c6fe93b5f00cc968e072029f02c7f71375350/prek-0.2.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:38c22c63bd18a29b27d4c56804fe10e5ae7e2a2b9d1ec2bcdbaebda9d80b2f86", size = 4256669, upload-time = "2025-09-15T15:14:00.191Z" },
+ { url = "https://files.pythonhosted.org/packages/00/ad/dadcb1a781db3c0feed31ab8c299494fe31ef6d5cd4de4929dfe381dafb6/prek-0.2.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e198ddf56591cbe455ffa2106caa6aa8f0df11348a328a68e46e9a0e877f80f6", size = 4553470, upload-time = "2025-09-15T15:14:01.586Z" },
+ { url = "https://files.pythonhosted.org/packages/c4/a1/58ee7dc741ddc49816edf9ba5a0bf4cefa9d1ccd2fcdcf988d525773bdfc/prek-0.2.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:5be95c28c65249576e43f7894869f09db7ed62602b70b456c777881304abebf5", size = 4979408, upload-time = "2025-09-15T15:14:03.165Z" },
+ { url = "https://files.pythonhosted.org/packages/b0/96/178ebf0523c47e43263e1e0f1f719d0f0b6fe8932876243eb1c9584457e7/prek-0.2.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0355c6c67afe7aa376685cb5747a45e3ba9bcc091d82547ec3725ceafbe139da", size = 4913040, upload-time = "2025-09-15T15:14:04.656Z" },
+ { url = "https://files.pythonhosted.org/packages/da/3f/773f1cab7284b0dd4a2f26df68dadc8b3c5a4ff5eaa6f3baec9e0fabeac9/prek-0.2.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b784eb070ac3cfea9598f8590f8aafcdae5a871a9bcfd88535c6f6f71f315252", size = 5031851, upload-time = "2025-09-15T15:14:06.075Z" },
+ { url = "https://files.pythonhosted.org/packages/da/bb/c5205b9e8561ca8e3925fb0072dc81c5a6ab57863e216aacabafb7bee40d/prek-0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:300ace6901a78a203030e76750d62cff1bdc9d64b08a998029a160a2435a5575", size = 4644291, upload-time = "2025-09-15T15:14:07.582Z" },
+ { url = "https://files.pythonhosted.org/packages/b1/d5/240376457cafc8a7e97ef72e2bbebd1c8d97dab2577c13a8b0485a8c4b49/prek-0.2.1-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:0b214b14d9c1cb4a3324206486cd2ea19e0c960bd2770785c49dbdaa2476a292", size = 4336230, upload-time = "2025-09-15T15:14:08.995Z" },
+ { url = "https://files.pythonhosted.org/packages/1d/70/a502fefb622186ce1d0f815f516fd368614fe5ecc596d0759d80e50da7d3/prek-0.2.1-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:a087ad088e08633469fe5b35411b6fcbc7c1bc78163f3fe2105142550917b581", size = 4424328, upload-time = "2025-09-15T15:14:10.627Z" },
+ { url = "https://files.pythonhosted.org/packages/97/d1/815eebdf760b8cdc129bd9818fd88b5ef91bddef4b1ce1dd1bae9aefbcb4/prek-0.2.1-py3-none-musllinux_1_1_armv7l.whl", hash = "sha256:e3b9f592af89d95b6a189f90f9f5c694086d340c79725ad165ae526a3be0be49", size = 4235667, upload-time = "2025-09-15T15:14:12.234Z" },
+ { url = "https://files.pythonhosted.org/packages/cc/6d/c86fceb0d2c4070a9218f8cb2b82b07cc2118acc910fa066ef8a78d1d15b/prek-0.2.1-py3-none-musllinux_1_1_i686.whl", hash = "sha256:194e7d898742f0e6565049f8e907e1237e5921b09c4c39ea572176e06296a745", size = 4449681, upload-time = "2025-09-15T15:14:13.723Z" },
+ { url = "https://files.pythonhosted.org/packages/97/a6/73678720f9f5a03288bac0ae7dc04fbe96fb01c4b31404480154a0776cc6/prek-0.2.1-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:483aa6f021874d887553cda5d651d989b2fa38f2334faffd53438a46999fc7ad", size = 4717583, upload-time = "2025-09-15T15:14:15.487Z" },
+ { url = "https://files.pythonhosted.org/packages/a2/1c/5a401e3c8db696f24bfa599022c743797af7a26bb1d5a8f79c5b0270afab/prek-0.2.1-py3-none-win32.whl", hash = "sha256:fbe488b478b47d9a7134d145b6564b90bfa1a1f7fec6bc7d7945aaa9a85f80cb", size = 4168471, upload-time = "2025-09-15T15:14:17.315Z" },
+ { url = "https://files.pythonhosted.org/packages/1d/70/cf844f271171e629dc29a496130317333867c6bcc02cc357eb80969ab328/prek-0.2.1-py3-none-win_amd64.whl", hash = "sha256:f066681ffb0f4de4c3a74dfb56cf417751ee2df2c38e2ed6af78d5e15262aa5d", size = 4719355, upload-time = "2025-09-15T15:14:18.784Z" },
+ { url = "https://files.pythonhosted.org/packages/20/63/1625310edb28937719eedfffcbd6e4728dd4d27f777a3f72fdf8c445976b/prek-0.2.1-py3-none-win_arm64.whl", hash = "sha256:97c8367e226930600dfad28405f091a0bc88cc601bfa66ace42ce1cd38e3ee92", size = 4414447, upload-time = "2025-09-15T15:14:20.43Z" },
]
[[package]]
(airflow) 07/07: Reduce default API server workers to 1 (#55707)
Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 083f6e25aae87c00fcf8bfc59566d2a2a1bf7935
Author: Jed Cunningham <66...@users.noreply.github.com>
AuthorDate: Tue Sep 16 08:03:27 2025 -0600
Reduce default API server workers to 1 (#55707)
Change the default number of API server workers from 4 to 1 and add
guidance to deploy multiple API servers for scaling instead of
increasing workers per server.
With FastAPI, sync code runs in an external thread pool, making
multiple workers within a single api server less necessary than it was in
our flask days. And with uvicorns new spawn behavior instead of fork,
it means no shared copy-on-write memory between workers, so it's better
to scale horizontally now.
(cherry picked from commit 87fc4697f742a792b5560fbb408ce8046e860e08)
---
airflow-core/newsfragments/55707.significant.rst | 23 ++++++++++++++++++++++
.../src/airflow/config_templates/config.yml | 6 ++++--
2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/airflow-core/newsfragments/55707.significant.rst b/airflow-core/newsfragments/55707.significant.rst
new file mode 100644
index 00000000000..07a42ba3b93
--- /dev/null
+++ b/airflow-core/newsfragments/55707.significant.rst
@@ -0,0 +1,23 @@
+Reduce default API server workers to 1
+
+The default number of API server workers (``[api] workers``) has been reduced from 4 to 1.
+
+With FastAPI, sync code runs in external thread pools, making multiple workers within a single
+process less necessary. Additionally, with uvicorn's spawn behavior instead of fork, there is
+no shared copy-on-write memory between workers, so horizontal scaling with multiple API server
+instances is now the recommended approach for better resource utilization and fault isolation.
+
+A good starting point for the number of workers is to set it to the number of CPU cores available.
+If you do have multiple CPU cores available for the API server, consider deploying multiple API
+server instances instead of increasing the number of workers.
+
+* Types of change
+
+ * [ ] Dag changes
+ * [x] Config changes
+ * [ ] API changes
+ * [ ] CLI changes
+ * [ ] Behaviour changes
+ * [ ] Plugin changes
+ * [ ] Dependency changes
+ * [ ] Code interface changes
diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml
index a2ab8aef90e..99c5476736a 100644
--- a/airflow-core/src/airflow/config_templates/config.yml
+++ b/airflow-core/src/airflow/config_templates/config.yml
@@ -1389,11 +1389,13 @@ api:
default: "8080"
workers:
description: |
- Number of workers to run on the API server
+ Number of workers to run on the API server. Should be roughly equal to the number of
+ cpu cores available. If you need to scale the API server, consider deploying multiple API
+ servers instead of increasing the number of workers.
version_added: ~
type: integer
example: ~
- default: "4"
+ default: "1"
worker_timeout:
description: |
Number of seconds the API server waits before timing out on a worker
(airflow) 04/07: Add HITLDetail.created_at (#55525)
Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit d91f7575a5d9aebd8ed9f86e9a1eaf062d8459a9
Author: Wei Lee <we...@gmail.com>
AuthorDate: Tue Sep 16 17:59:51 2025 +0800
Add HITLDetail.created_at (#55525)
(cherry picked from commit bfc0f8940461eae3b85196e82818c6b9d4bbe376)
---
airflow-core/docs/img/airflow_erd.sha256 | 2 +-
airflow-core/docs/img/airflow_erd.svg | 121 +++++++++++----------
.../api_fastapi/core_api/datamodels/hitl.py | 1 +
.../api_fastapi/core_api/openapi/_private_ui.yaml | 5 +
.../core_api/openapi/v2-rest-api-generated.yaml | 41 +++++++
.../api_fastapi/core_api/routes/public/hitl.py | 5 +
.../0076_3_1_0_add_human_in_the_loop_response.py | 2 +
airflow-core/src/airflow/models/hitl.py | 2 +
.../src/airflow/ui/openapi-gen/queries/common.ts | 8 +-
.../ui/openapi-gen/queries/ensureQueryData.ts | 12 +-
.../src/airflow/ui/openapi-gen/queries/prefetch.ts | 12 +-
.../src/airflow/ui/openapi-gen/queries/queries.ts | 12 +-
.../src/airflow/ui/openapi-gen/queries/suspense.ts | 12 +-
.../airflow/ui/openapi-gen/requests/schemas.gen.ts | 7 +-
.../ui/openapi-gen/requests/services.gen.ts | 10 +-
.../airflow/ui/openapi-gen/requests/types.gen.ts | 5 +
.../core_api/routes/public/test_hitl.py | 34 +++++-
.../api_fastapi/core_api/routes/ui/test_dags.py | 1 +
.../src/airflowctl/api/datamodels/generated.py | 1 +
19 files changed, 220 insertions(+), 73 deletions(-)
diff --git a/airflow-core/docs/img/airflow_erd.sha256 b/airflow-core/docs/img/airflow_erd.sha256
index ba060d4f5ee..bf88ae1d3c4 100644
--- a/airflow-core/docs/img/airflow_erd.sha256
+++ b/airflow-core/docs/img/airflow_erd.sha256
@@ -1 +1 @@
-35e9e07930e138664fb6ff23bc299567a88946734630d84f3d7d95deacf2f4b8
\ No newline at end of file
+35b8a7f30e44075373199a53e6634693f4254287a9ecff0582d9ae926fc7aaae
\ No newline at end of file
diff --git a/airflow-core/docs/img/airflow_erd.svg b/airflow-core/docs/img/airflow_erd.svg
index 6fbf9c224a4..c6fc5f0ea7d 100644
--- a/airflow-core/docs/img/airflow_erd.svg
+++ b/airflow-core/docs/img/airflow_erd.svg
@@ -1437,68 +1437,73 @@
<!-- hitl_detail -->
<g id="node43" class="node">
<title>hitl_detail</title>
-<polygon fill="none" stroke="black" points="2197,-2304 2197,-2332 2435,-2332 2435,-2304 2197,-2304"/>
-<text text-anchor="start" x="2272" y="-2315.2" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">hitl_detail</text>
-<polygon fill="none" stroke="black" points="2197,-2279 2197,-2304 2435,-2304 2435,-2279 2197,-2279"/>
-<text text-anchor="start" x="2202" y="-2288.8" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">ti_id</text>
-<text text-anchor="start" x="2231" y="-2288.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="2236" y="-2288.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [UUID]</text>
-<text text-anchor="start" x="2288" y="-2288.8" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="2197,-2254 2197,-2279 2435,-2279 2435,-2254 2197,-2254"/>
-<text text-anchor="start" x="2202" y="-2263.8" font-family="Helvetica,sans-Serif" font-size="14.00">assignees</text>
-<text text-anchor="start" x="2272" y="-2263.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="2277" y="-2263.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
-<polygon fill="none" stroke="black" points="2197,-2229 2197,-2254 2435,-2254 2435,-2229 2197,-2229"/>
-<text text-anchor="start" x="2202" y="-2238.8" font-family="Helvetica,sans-Serif" font-size="14.00">body</text>
-<text text-anchor="start" x="2237" y="-2238.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="2242" y="-2238.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
-<polygon fill="none" stroke="black" points="2197,-2204 2197,-2229 2435,-2229 2435,-2204 2197,-2204"/>
-<text text-anchor="start" x="2202" y="-2213.8" font-family="Helvetica,sans-Serif" font-size="14.00">chosen_options</text>
-<text text-anchor="start" x="2310" y="-2213.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="2315" y="-2213.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
-<polygon fill="none" stroke="black" points="2197,-2179 2197,-2204 2435,-2204 2435,-2179 2197,-2179"/>
-<text text-anchor="start" x="2202" y="-2188.8" font-family="Helvetica,sans-Serif" font-size="14.00">defaults</text>
-<text text-anchor="start" x="2259" y="-2188.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="2264" y="-2188.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
-<polygon fill="none" stroke="black" points="2197,-2154 2197,-2179 2435,-2179 2435,-2154 2197,-2154"/>
-<text text-anchor="start" x="2202" y="-2163.8" font-family="Helvetica,sans-Serif" font-size="14.00">multiple</text>
-<text text-anchor="start" x="2259" y="-2163.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="2264" y="-2163.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [BOOLEAN]</text>
-<polygon fill="none" stroke="black" points="2197,-2129 2197,-2154 2435,-2154 2435,-2129 2197,-2129"/>
-<text text-anchor="start" x="2202" y="-2138.8" font-family="Helvetica,sans-Serif" font-size="14.00">options</text>
-<text text-anchor="start" x="2254" y="-2138.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="2259" y="-2138.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
-<text text-anchor="start" x="2310" y="-2138.8" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="2197,-2104 2197,-2129 2435,-2129 2435,-2104 2197,-2104"/>
-<text text-anchor="start" x="2202" y="-2113.8" font-family="Helvetica,sans-Serif" font-size="14.00">params</text>
-<text text-anchor="start" x="2255" y="-2113.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="2260" y="-2113.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
-<text text-anchor="start" x="2311" y="-2113.8" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="2197,-2079 2197,-2104 2435,-2104 2435,-2079 2197,-2079"/>
-<text text-anchor="start" x="2202" y="-2088.8" font-family="Helvetica,sans-Serif" font-size="14.00">params_input</text>
-<text text-anchor="start" x="2298" y="-2088.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="2303" y="-2088.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
-<text text-anchor="start" x="2354" y="-2088.8" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
-<polygon fill="none" stroke="black" points="2197,-2054 2197,-2079 2435,-2079 2435,-2054 2197,-2054"/>
-<text text-anchor="start" x="2202" y="-2063.8" font-family="Helvetica,sans-Serif" font-size="14.00">responded_at</text>
-<text text-anchor="start" x="2296" y="-2063.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="2301" y="-2063.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
-<polygon fill="none" stroke="black" points="2197,-2029 2197,-2054 2435,-2054 2435,-2029 2197,-2029"/>
-<text text-anchor="start" x="2202" y="-2038.8" font-family="Helvetica,sans-Serif" font-size="14.00">responded_by</text>
-<text text-anchor="start" x="2300" y="-2038.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="2305" y="-2038.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
-<polygon fill="none" stroke="black" points="2197,-2004 2197,-2029 2435,-2029 2435,-2004 2197,-2004"/>
-<text text-anchor="start" x="2202" y="-2013.8" font-family="Helvetica,sans-Serif" font-size="14.00">subject</text>
-<text text-anchor="start" x="2253" y="-2013.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
-<text text-anchor="start" x="2258" y="-2013.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
-<text text-anchor="start" x="2308" y="-2013.8" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="2186,-2328 2186,-2356 2446,-2356 2446,-2328 2186,-2328"/>
+<text text-anchor="start" x="2272" y="-2339.2" font-family="Helvetica,sans-Serif" font-weight="bold" font-size="16.00">hitl_detail</text>
+<polygon fill="none" stroke="black" points="2186,-2303 2186,-2328 2446,-2328 2446,-2303 2186,-2303"/>
+<text text-anchor="start" x="2191" y="-2312.8" font-family="Helvetica,sans-Serif" text-decoration="underline" font-size="14.00">ti_id</text>
+<text text-anchor="start" x="2220" y="-2312.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2225" y="-2312.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [UUID]</text>
+<text text-anchor="start" x="2277" y="-2312.8" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="2186,-2278 2186,-2303 2446,-2303 2446,-2278 2186,-2278"/>
+<text text-anchor="start" x="2191" y="-2287.8" font-family="Helvetica,sans-Serif" font-size="14.00">assignees</text>
+<text text-anchor="start" x="2261" y="-2287.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2266" y="-2287.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
+<polygon fill="none" stroke="black" points="2186,-2253 2186,-2278 2446,-2278 2446,-2253 2186,-2253"/>
+<text text-anchor="start" x="2191" y="-2262.8" font-family="Helvetica,sans-Serif" font-size="14.00">body</text>
+<text text-anchor="start" x="2226" y="-2262.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2231" y="-2262.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
+<polygon fill="none" stroke="black" points="2186,-2228 2186,-2253 2446,-2253 2446,-2228 2186,-2228"/>
+<text text-anchor="start" x="2191" y="-2237.8" font-family="Helvetica,sans-Serif" font-size="14.00">chosen_options</text>
+<text text-anchor="start" x="2299" y="-2237.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2304" y="-2237.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
+<polygon fill="none" stroke="black" points="2186,-2203 2186,-2228 2446,-2228 2446,-2203 2186,-2203"/>
+<text text-anchor="start" x="2191" y="-2212.8" font-family="Helvetica,sans-Serif" font-size="14.00">created_at</text>
+<text text-anchor="start" x="2264" y="-2212.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2269" y="-2212.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
+<text text-anchor="start" x="2365" y="-2212.8" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="2186,-2178 2186,-2203 2446,-2203 2446,-2178 2186,-2178"/>
+<text text-anchor="start" x="2191" y="-2187.8" font-family="Helvetica,sans-Serif" font-size="14.00">defaults</text>
+<text text-anchor="start" x="2248" y="-2187.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2253" y="-2187.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
+<polygon fill="none" stroke="black" points="2186,-2153 2186,-2178 2446,-2178 2446,-2153 2186,-2153"/>
+<text text-anchor="start" x="2191" y="-2162.8" font-family="Helvetica,sans-Serif" font-size="14.00">multiple</text>
+<text text-anchor="start" x="2248" y="-2162.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2253" y="-2162.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [BOOLEAN]</text>
+<polygon fill="none" stroke="black" points="2186,-2128 2186,-2153 2446,-2153 2446,-2128 2186,-2128"/>
+<text text-anchor="start" x="2191" y="-2137.8" font-family="Helvetica,sans-Serif" font-size="14.00">options</text>
+<text text-anchor="start" x="2243" y="-2137.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2248" y="-2137.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
+<text text-anchor="start" x="2299" y="-2137.8" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="2186,-2103 2186,-2128 2446,-2128 2446,-2103 2186,-2103"/>
+<text text-anchor="start" x="2191" y="-2112.8" font-family="Helvetica,sans-Serif" font-size="14.00">params</text>
+<text text-anchor="start" x="2244" y="-2112.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2249" y="-2112.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
+<text text-anchor="start" x="2300" y="-2112.8" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="2186,-2078 2186,-2103 2446,-2103 2446,-2078 2186,-2078"/>
+<text text-anchor="start" x="2191" y="-2087.8" font-family="Helvetica,sans-Serif" font-size="14.00">params_input</text>
+<text text-anchor="start" x="2287" y="-2087.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2292" y="-2087.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
+<text text-anchor="start" x="2343" y="-2087.8" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
+<polygon fill="none" stroke="black" points="2186,-2053 2186,-2078 2446,-2078 2446,-2053 2186,-2053"/>
+<text text-anchor="start" x="2191" y="-2062.8" font-family="Helvetica,sans-Serif" font-size="14.00">responded_at</text>
+<text text-anchor="start" x="2285" y="-2062.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2290" y="-2062.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [TIMESTAMP]</text>
+<polygon fill="none" stroke="black" points="2186,-2028 2186,-2053 2446,-2053 2446,-2028 2186,-2028"/>
+<text text-anchor="start" x="2191" y="-2037.8" font-family="Helvetica,sans-Serif" font-size="14.00">responded_by</text>
+<text text-anchor="start" x="2289" y="-2037.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2294" y="-2037.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [JSON]</text>
+<polygon fill="none" stroke="black" points="2186,-2003 2186,-2028 2446,-2028 2446,-2003 2186,-2003"/>
+<text text-anchor="start" x="2191" y="-2012.8" font-family="Helvetica,sans-Serif" font-size="14.00">subject</text>
+<text text-anchor="start" x="2242" y="-2012.8" font-family="Helvetica,sans-Serif" font-size="14.00"> </text>
+<text text-anchor="start" x="2247" y="-2012.8" font-family="Helvetica,sans-Serif" font-size="14.00"> [TEXT]</text>
+<text text-anchor="start" x="2297" y="-2012.8" font-family="Helvetica,sans-Serif" font-size="14.00"> NOT NULL</text>
</g>
<!-- task_instance--hitl_detail -->
<g id="edge48" class="edge">
<title>task_instance--hitl_detail</title>
-<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2081.05,-1862.88C2103.53,-1907.23 2127.94,-1950.81 2154,-1991 2164.45,-2007.12 2176.38,-2023.19 2188.91,-2038.71"/>
-<text text-anchor="start" x="2178.91" y="-2027.51" font-family="Times,serif" font-size="14.00">1</text>
-<text text-anchor="start" x="2081.05" y="-1851.68" font-family="Times,serif" font-size="14.00">1</text>
+<path fill="none" stroke="#7f7f7f" stroke-dasharray="5,2" d="M2081.12,-1859.57C2103.71,-1904.92 2128.13,-1949.64 2154,-1991 2161.37,-2002.79 2169.44,-2014.6 2177.92,-2026.25"/>
+<text text-anchor="start" x="2167.92" y="-2015.05" font-family="Times,serif" font-size="14.00">1</text>
+<text text-anchor="start" x="2081.12" y="-1848.37" font-family="Times,serif" font-size="14.00">1</text>
</g>
<!-- task_map -->
<g id="node44" class="node">
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/hitl.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/hitl.py
index f24688c13e5..aa4f44f212b 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/hitl.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/hitl.py
@@ -63,6 +63,7 @@ class HITLDetail(BaseModel):
multiple: bool = False
params: dict[str, Any] = Field(default_factory=dict)
assigned_users: list[HITLUser] = Field(default_factory=list)
+ created_at: datetime
# Response Content Detail
responded_by_user: HITLUser | None = None
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml
index 269f60cd4c3..ec079113922 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml
+++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/_private_ui.yaml
@@ -1999,6 +1999,10 @@ components:
$ref: '#/components/schemas/HITLUser'
type: array
title: Assigned Users
+ created_at:
+ type: string
+ format: date-time
+ title: Created At
responded_by_user:
anyOf:
- $ref: '#/components/schemas/HITLUser'
@@ -2029,6 +2033,7 @@ components:
- task_instance
- options
- subject
+ - created_at
title: HITLDetail
description: Schema for Human-in-the-loop detail.
HITLUser:
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml
index e853fcbd386..a54062a172a 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml
+++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml
@@ -8236,6 +8236,42 @@ paths:
title: Body Search
description: "SQL LIKE expression \u2014 use `%` / `_` wildcards (e.g. `%customer_%`).\
\ Regular expressions are **not** supported."
+ - name: created_at_gte
+ in: query
+ required: false
+ schema:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ title: Created At Gte
+ - name: created_at_gt
+ in: query
+ required: false
+ schema:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ title: Created At Gt
+ - name: created_at_lte
+ in: query
+ required: false
+ schema:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ title: Created At Lte
+ - name: created_at_lt
+ in: query
+ required: false
+ schema:
+ anyOf:
+ - type: string
+ format: date-time
+ - type: 'null'
+ title: Created At Lt
responses:
'200':
description: Successful Response
@@ -10857,6 +10893,10 @@ components:
$ref: '#/components/schemas/HITLUser'
type: array
title: Assigned Users
+ created_at:
+ type: string
+ format: date-time
+ title: Created At
responded_by_user:
anyOf:
- $ref: '#/components/schemas/HITLUser'
@@ -10887,6 +10927,7 @@ components:
- task_instance
- options
- subject
+ - created_at
title: HITLDetail
description: Schema for Human-in-the-loop detail.
HITLDetailCollection:
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/hitl.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/hitl.py
index 60d9f99fab9..f4b1e0baae2 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/hitl.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/hitl.py
@@ -38,7 +38,9 @@ from airflow.api_fastapi.common.parameters import (
QueryLimit,
QueryOffset,
QueryTIStateFilter,
+ RangeFilter,
SortParam,
+ datetime_range_filter_factory,
)
from airflow.api_fastapi.common.router import AirflowRouter
from airflow.api_fastapi.core_api.datamodels.hitl import (
@@ -209,6 +211,7 @@ def get_hitl_details(
"ti_id",
"subject",
"responded_at",
+ "created_at",
],
model=HITLDetailModel,
to_replace={
@@ -234,6 +237,7 @@ def get_hitl_details(
responded_user_name: QueryHITLDetailRespondedUserNameFilter,
subject_patten: QueryHITLDetailSubjectSearch,
body_patten: QueryHITLDetailBodySearch,
+ created_at: Annotated[RangeFilter, Depends(datetime_range_filter_factory("created_at", HITLDetailModel))],
) -> HITLDetailCollection:
"""Get Human-in-the-loop details."""
query = (
@@ -265,6 +269,7 @@ def get_hitl_details(
responded_user_name,
subject_patten,
body_patten,
+ created_at,
],
offset=offset,
limit=limit,
diff --git a/airflow-core/src/airflow/migrations/versions/0076_3_1_0_add_human_in_the_loop_response.py b/airflow-core/src/airflow/migrations/versions/0076_3_1_0_add_human_in_the_loop_response.py
index cd875711ca4..3105d453e45 100644
--- a/airflow-core/src/airflow/migrations/versions/0076_3_1_0_add_human_in_the_loop_response.py
+++ b/airflow-core/src/airflow/migrations/versions/0076_3_1_0_add_human_in_the_loop_response.py
@@ -32,6 +32,7 @@ from alembic import op
from sqlalchemy import Boolean, Column, ForeignKeyConstraint, String, Text
from sqlalchemy.dialects import postgresql
+from airflow._shared.timezones import timezone
from airflow.settings import json
from airflow.utils.sqlalchemy import UtcDateTime
@@ -60,6 +61,7 @@ def upgrade():
Column("multiple", Boolean, unique=False, default=False),
Column("params", sqlalchemy_jsonfield.JSONField(json=json), nullable=False, default={}),
Column("assignees", sqlalchemy_jsonfield.JSONField(json=json), nullable=True),
+ Column("created_at", UtcDateTime(timezone=True), nullable=False, default=timezone.utcnow),
Column("responded_at", UtcDateTime, nullable=True),
Column("responded_by", sqlalchemy_jsonfield.JSONField(json=json), nullable=True),
Column("chosen_options", sqlalchemy_jsonfield.JSONField(json=json), nullable=True),
diff --git a/airflow-core/src/airflow/models/hitl.py b/airflow-core/src/airflow/models/hitl.py
index f13c4a6117f..b6bbb2bc402 100644
--- a/airflow-core/src/airflow/models/hitl.py
+++ b/airflow-core/src/airflow/models/hitl.py
@@ -26,6 +26,7 @@ from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm import relationship
from sqlalchemy.sql.functions import FunctionElement
+from airflow._shared.timezones import timezone
from airflow.models.base import Base
from airflow.settings import json
from airflow.utils.sqlalchemy import UtcDateTime
@@ -97,6 +98,7 @@ class HITLDetail(Base):
multiple = Column(Boolean, unique=False, default=False)
params = Column(sqlalchemy_jsonfield.JSONField(json=json), nullable=False, default={})
assignees = Column(sqlalchemy_jsonfield.JSONField(json=json), nullable=True)
+ created_at = Column(UtcDateTime, default=timezone.utcnow, nullable=False)
# Response Content Detail
responded_at = Column(UtcDateTime, nullable=True)
diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/common.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/common.ts
index 3a937cdd85f..4cc84c1ad3a 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/queries/common.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/queries/common.ts
@@ -564,8 +564,12 @@ export const UseTaskInstanceServiceGetHitlDetailKeyFn = ({ dagId, dagRunId, mapI
export type TaskInstanceServiceGetHitlDetailsDefaultResponse = Awaited<ReturnType<typeof TaskInstanceService.getHitlDetails>>;
export type TaskInstanceServiceGetHitlDetailsQueryResult<TData = TaskInstanceServiceGetHitlDetailsDefaultResponse, TError = unknown> = UseQueryResult<TData, TError>;
export const useTaskInstanceServiceGetHitlDetailsKey = "TaskInstanceServiceGetHitlDetails";
-export const UseTaskInstanceServiceGetHitlDetailsKeyFn = ({ bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }: {
+export const UseTaskInstanceServiceGetHitlDetailsKeyFn = ({ bodySearch, createdAtGt, createdAtGte, createdAtLt, createdAtLte, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }: {
bodySearch?: string;
+ createdAtGt?: string;
+ createdAtGte?: string;
+ createdAtLt?: string;
+ createdAtLte?: string;
dagId: string;
dagIdPattern?: string;
dagRunId: string;
@@ -579,7 +583,7 @@ export const UseTaskInstanceServiceGetHitlDetailsKeyFn = ({ bodySearch, dagId, d
subjectSearch?: string;
taskId?: string;
taskIdPattern?: string;
-}, queryKey?: Array<unknown>) => [useTaskInstanceServiceGetHitlDetailsKey, ...(queryKey ?? [{ bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }])];
+}, queryKey?: Array<unknown>) => [useTaskInstanceServiceGetHitlDetailsKey, ...(queryKey ?? [{ bodySearch, createdAtGt, createdAtGte, createdAtLt, createdAtLte, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }])];
export type ImportErrorServiceGetImportErrorDefaultResponse = Awaited<ReturnType<typeof ImportErrorService.getImportError>>;
export type ImportErrorServiceGetImportErrorQueryResult<TData = ImportErrorServiceGetImportErrorDefaultResponse, TError = unknown> = UseQueryResult<TData, TError>;
export const useImportErrorServiceGetImportErrorKey = "ImportErrorServiceGetImportError";
diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/ensureQueryData.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/ensureQueryData.ts
index bad321b274c..39129114dc5 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/queries/ensureQueryData.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/queries/ensureQueryData.ts
@@ -1083,11 +1083,19 @@ export const ensureUseTaskInstanceServiceGetHitlDetailData = (queryClient: Query
* @param data.respondedByUserName
* @param data.subjectSearch SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
* @param data.bodySearch SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
+* @param data.createdAtGte
+* @param data.createdAtGt
+* @param data.createdAtLte
+* @param data.createdAtLt
* @returns HITLDetailCollection Successful Response
* @throws ApiError
*/
-export const ensureUseTaskInstanceServiceGetHitlDetailsData = (queryClient: QueryClient, { bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }: {
+export const ensureUseTaskInstanceServiceGetHitlDetailsData = (queryClient: QueryClient, { bodySearch, createdAtGt, createdAtGte, createdAtLt, createdAtLte, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }: {
bodySearch?: string;
+ createdAtGt?: string;
+ createdAtGte?: string;
+ createdAtLt?: string;
+ createdAtLte?: string;
dagId: string;
dagIdPattern?: string;
dagRunId: string;
@@ -1101,7 +1109,7 @@ export const ensureUseTaskInstanceServiceGetHitlDetailsData = (queryClient: Quer
subjectSearch?: string;
taskId?: string;
taskIdPattern?: string;
-}) => queryClient.ensureQueryData({ queryKey: Common.UseTaskInstanceServiceGetHitlDetailsKeyFn({ bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }), queryFn: () => TaskInstanceService.getHitlDetails({ bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }) });
+}) => queryClient.ensureQueryData({ queryKey: Common.UseTaskInstanceServiceGetHitlDetailsKeyFn({ bodySearch, createdAtGt, createdAtGte, createdAtLt, createdAtLte, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }), queryFn: () => TaskInstanceService.getHitlDetails({ bodySearch, createdAtGt, createdAtGte, createdAtLt, createdAtLte, dagId, dagIdPattern, dagRunId, limit, offset, orde [...]
/**
* Get Import Error
* Get an import error.
diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/prefetch.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/prefetch.ts
index 0f3565e9fe0..c9d8961be12 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/queries/prefetch.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/queries/prefetch.ts
@@ -1083,11 +1083,19 @@ export const prefetchUseTaskInstanceServiceGetHitlDetail = (queryClient: QueryCl
* @param data.respondedByUserName
* @param data.subjectSearch SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
* @param data.bodySearch SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
+* @param data.createdAtGte
+* @param data.createdAtGt
+* @param data.createdAtLte
+* @param data.createdAtLt
* @returns HITLDetailCollection Successful Response
* @throws ApiError
*/
-export const prefetchUseTaskInstanceServiceGetHitlDetails = (queryClient: QueryClient, { bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }: {
+export const prefetchUseTaskInstanceServiceGetHitlDetails = (queryClient: QueryClient, { bodySearch, createdAtGt, createdAtGte, createdAtLt, createdAtLte, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }: {
bodySearch?: string;
+ createdAtGt?: string;
+ createdAtGte?: string;
+ createdAtLt?: string;
+ createdAtLte?: string;
dagId: string;
dagIdPattern?: string;
dagRunId: string;
@@ -1101,7 +1109,7 @@ export const prefetchUseTaskInstanceServiceGetHitlDetails = (queryClient: QueryC
subjectSearch?: string;
taskId?: string;
taskIdPattern?: string;
-}) => queryClient.prefetchQuery({ queryKey: Common.UseTaskInstanceServiceGetHitlDetailsKeyFn({ bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }), queryFn: () => TaskInstanceService.getHitlDetails({ bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }) });
+}) => queryClient.prefetchQuery({ queryKey: Common.UseTaskInstanceServiceGetHitlDetailsKeyFn({ bodySearch, createdAtGt, createdAtGte, createdAtLt, createdAtLte, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }), queryFn: () => TaskInstanceService.getHitlDetails({ bodySearch, createdAtGt, createdAtGte, createdAtLt, createdAtLte, dagId, dagIdPattern, dagRunId, limit, offset, orderB [...]
/**
* Get Import Error
* Get an import error.
diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts
index 9d23ddbcfe6..3594ae23797 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts
@@ -1083,11 +1083,19 @@ export const useTaskInstanceServiceGetHitlDetail = <TData = Common.TaskInstanceS
* @param data.respondedByUserName
* @param data.subjectSearch SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
* @param data.bodySearch SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
+* @param data.createdAtGte
+* @param data.createdAtGt
+* @param data.createdAtLte
+* @param data.createdAtLt
* @returns HITLDetailCollection Successful Response
* @throws ApiError
*/
-export const useTaskInstanceServiceGetHitlDetails = <TData = Common.TaskInstanceServiceGetHitlDetailsDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>({ bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }: {
+export const useTaskInstanceServiceGetHitlDetails = <TData = Common.TaskInstanceServiceGetHitlDetailsDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>({ bodySearch, createdAtGt, createdAtGte, createdAtLt, createdAtLte, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }: {
bodySearch?: string;
+ createdAtGt?: string;
+ createdAtGte?: string;
+ createdAtLt?: string;
+ createdAtLte?: string;
dagId: string;
dagIdPattern?: string;
dagRunId: string;
@@ -1101,7 +1109,7 @@ export const useTaskInstanceServiceGetHitlDetails = <TData = Common.TaskInstance
subjectSearch?: string;
taskId?: string;
taskIdPattern?: string;
-}, queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useQuery<TData, TError>({ queryKey: Common.UseTaskInstanceServiceGetHitlDetailsKeyFn({ bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }, queryKey), queryFn: () => TaskInstanceService.getHitlDetails({ bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, res [...]
+}, queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useQuery<TData, TError>({ queryKey: Common.UseTaskInstanceServiceGetHitlDetailsKeyFn({ bodySearch, createdAtGt, createdAtGte, createdAtLt, createdAtLte, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }, queryKey), queryFn: () => TaskInstanceService.getHitlDetails({ bodySearch, crea [...]
/**
* Get Import Error
* Get an import error.
diff --git a/airflow-core/src/airflow/ui/openapi-gen/queries/suspense.ts b/airflow-core/src/airflow/ui/openapi-gen/queries/suspense.ts
index 4d5fea56dac..61cb9a59f07 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/queries/suspense.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/queries/suspense.ts
@@ -1083,11 +1083,19 @@ export const useTaskInstanceServiceGetHitlDetailSuspense = <TData = Common.TaskI
* @param data.respondedByUserName
* @param data.subjectSearch SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
* @param data.bodySearch SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
+* @param data.createdAtGte
+* @param data.createdAtGt
+* @param data.createdAtLte
+* @param data.createdAtLt
* @returns HITLDetailCollection Successful Response
* @throws ApiError
*/
-export const useTaskInstanceServiceGetHitlDetailsSuspense = <TData = Common.TaskInstanceServiceGetHitlDetailsDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>({ bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }: {
+export const useTaskInstanceServiceGetHitlDetailsSuspense = <TData = Common.TaskInstanceServiceGetHitlDetailsDefaultResponse, TError = unknown, TQueryKey extends Array<unknown> = unknown[]>({ bodySearch, createdAtGt, createdAtGte, createdAtLt, createdAtLte, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }: {
bodySearch?: string;
+ createdAtGt?: string;
+ createdAtGte?: string;
+ createdAtLt?: string;
+ createdAtLte?: string;
dagId: string;
dagIdPattern?: string;
dagRunId: string;
@@ -1101,7 +1109,7 @@ export const useTaskInstanceServiceGetHitlDetailsSuspense = <TData = Common.Task
subjectSearch?: string;
taskId?: string;
taskIdPattern?: string;
-}, queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useSuspenseQuery<TData, TError>({ queryKey: Common.UseTaskInstanceServiceGetHitlDetailsKeyFn({ bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }, queryKey), queryFn: () => TaskInstanceService.getHitlDetails({ bodySearch, dagId, dagIdPattern, dagRunId, limit, offset, orde [...]
+}, queryKey?: TQueryKey, options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">) => useSuspenseQuery<TData, TError>({ queryKey: Common.UseTaskInstanceServiceGetHitlDetailsKeyFn({ bodySearch, createdAtGt, createdAtGte, createdAtLt, createdAtLte, dagId, dagIdPattern, dagRunId, limit, offset, orderBy, respondedByUserId, respondedByUserName, responseReceived, state, subjectSearch, taskId, taskIdPattern }, queryKey), queryFn: () => TaskInstanceService.getHitlDetails({ bodySear [...]
/**
* Get Import Error
* Get an import error.
diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts
index 1cf2a46b461..32dafcb90fd 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/requests/schemas.gen.ts
@@ -3578,6 +3578,11 @@ export const $HITLDetail = {
type: 'array',
title: 'Assigned Users'
},
+ created_at: {
+ type: 'string',
+ format: 'date-time',
+ title: 'Created At'
+ },
responded_by_user: {
anyOf: [
{
@@ -3626,7 +3631,7 @@ export const $HITLDetail = {
}
},
type: 'object',
- required: ['task_instance', 'options', 'subject'],
+ required: ['task_instance', 'options', 'subject', 'created_at'],
title: 'HITLDetail',
description: 'Schema for Human-in-the-loop detail.'
} as const;
diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts
index 468bea4460d..9cd340c85a0 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts
@@ -2792,6 +2792,10 @@ export class TaskInstanceService {
* @param data.respondedByUserName
* @param data.subjectSearch SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
* @param data.bodySearch SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
+ * @param data.createdAtGte
+ * @param data.createdAtGt
+ * @param data.createdAtLte
+ * @param data.createdAtLt
* @returns HITLDetailCollection Successful Response
* @throws ApiError
*/
@@ -2815,7 +2819,11 @@ export class TaskInstanceService {
responded_by_user_id: data.respondedByUserId,
responded_by_user_name: data.respondedByUserName,
subject_search: data.subjectSearch,
- body_search: data.bodySearch
+ body_search: data.bodySearch,
+ created_at_gte: data.createdAtGte,
+ created_at_gt: data.createdAtGt,
+ created_at_lte: data.createdAtLte,
+ created_at_lt: data.createdAtLt
},
errors: {
401: 'Unauthorized',
diff --git a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts
index 18d40ed2531..5ee9f5edf90 100644
--- a/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts
+++ b/airflow-core/src/airflow/ui/openapi-gen/requests/types.gen.ts
@@ -941,6 +941,7 @@ export type HITLDetail = {
[key: string]: unknown;
};
assigned_users?: Array<HITLUser>;
+ created_at: string;
responded_by_user?: HITLUser | null;
responded_at?: string | null;
chosen_options?: Array<(string)> | null;
@@ -2851,6 +2852,10 @@ export type GetHitlDetailsData = {
* SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
*/
bodySearch?: string | null;
+ createdAtGt?: string | null;
+ createdAtGte?: string | null;
+ createdAtLt?: string | null;
+ createdAtLte?: string | null;
dagId: string;
/**
* SQL LIKE expression — use `%` / `_` wildcards (e.g. `%customer_%`). Regular expressions are **not** supported.
diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_hitl.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_hitl.py
index 61f6488d5fc..f8ab8e1c4d9 100644
--- a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_hitl.py
+++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_hitl.py
@@ -18,7 +18,7 @@ from __future__ import annotations
import json
from collections.abc import Callable
-from datetime import datetime
+from datetime import datetime, timedelta
from operator import itemgetter
from typing import TYPE_CHECKING, Any
from unittest import mock
@@ -28,12 +28,14 @@ import time_machine
from sqlalchemy import select
from sqlalchemy.orm import Session
-from airflow._shared.timezones.timezone import utcnow
+from airflow._shared.timezones.timezone import utc, utcnow
from airflow.models.hitl import HITLDetail
from airflow.models.log import Log
from airflow.sdk.execution_time.hitl import HITLUser
from airflow.utils.state import TaskInstanceState
+from tests_common.test_utils.format_datetime import from_datetime_to_zulu_without_ms
+
if TYPE_CHECKING:
from fastapi.testclient import TestClient
@@ -49,6 +51,10 @@ ANOTHER_DAG_ID = "another_hitl_dag"
TASK_ID = "sample_task_hitl"
+DEFAULT_CREATED_AT = datetime(2025, 9, 15, 13, 0, 0, tzinfo=utc)
+ANOTHER_CREATED_AT = datetime(2025, 9, 16, 12, 0, 0, tzinfo=utc)
+
+
@pytest.fixture
def sample_ti(
create_task_instance: CreateTaskInstance,
@@ -158,6 +164,7 @@ def sample_hitl_details(sample_tis: list[TaskInstance], session: Session) -> lis
defaults=["Approve"],
multiple=False,
params={"input_1": 1},
+ created_at=DEFAULT_CREATED_AT,
)
for i, ti in enumerate(sample_tis[:5])
]
@@ -175,6 +182,7 @@ def sample_hitl_details(sample_tis: list[TaskInstance], session: Session) -> lis
chosen_options=[str(i)],
params_input={"input": i},
responded_by={"id": "test", "name": "test"},
+ created_at=ANOTHER_CREATED_AT,
)
for i, ti in enumerate(sample_tis[5:])
]
@@ -209,6 +217,7 @@ def expected_sample_hitl_detail_dict(sample_ti: TaskInstance) -> dict[str, Any]:
"options": ["Approve", "Reject"],
"params": {"input_1": 1},
"assigned_users": [],
+ "created_at": mock.ANY,
"params_input": {},
"responded_at": None,
"chosen_options": None,
@@ -542,6 +551,21 @@ class TestGetHITLDetailsEndpoint:
({"response_received": True}, 3),
({"responded_by_user_id": ["test"]}, 3),
({"responded_by_user_name": ["test"]}, 3),
+ (
+ {"created_at_gte": from_datetime_to_zulu_without_ms(DEFAULT_CREATED_AT + timedelta(days=1))},
+ 0,
+ ),
+ (
+ {"created_at_lte": from_datetime_to_zulu_without_ms(DEFAULT_CREATED_AT - timedelta(days=1))},
+ 0,
+ ),
+ (
+ {
+ "created_at_gte": from_datetime_to_zulu_without_ms(DEFAULT_CREATED_AT),
+ "created_at_lte": from_datetime_to_zulu_without_ms(DEFAULT_CREATED_AT),
+ },
+ 5,
+ ),
],
ids=[
"dag_id_pattern_hitl_dag",
@@ -556,6 +580,9 @@ class TestGetHITLDetailsEndpoint:
"response_received",
"responded_user_id",
"responded_user_name",
+ "created_at_gte",
+ "created_at_lte",
+ "created_at",
],
)
def test_should_respond_200_with_existing_response_and_query(
@@ -587,6 +614,7 @@ class TestGetHITLDetailsEndpoint:
"multiple": False,
"params": {"input_1": 1},
"assigned_users": [],
+ "created_at": DEFAULT_CREATED_AT.isoformat().replace("+00:00", "Z"),
"responded_by_user": None,
"responded_at": None,
"chosen_options": None,
@@ -612,6 +640,7 @@ class TestGetHITLDetailsEndpoint:
# htil key
("subject", itemgetter("subject")),
("responded_at", itemgetter("responded_at")),
+ ("created_at", itemgetter("created_at")),
],
ids=[
"ti_id",
@@ -622,6 +651,7 @@ class TestGetHITLDetailsEndpoint:
"task_instance_operator",
"subject",
"responded_at",
+ "created_at",
],
)
def test_should_respond_200_with_existing_response_and_order_by(
diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_dags.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_dags.py
index d58f29839b6..5ebf2221d92 100644
--- a/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_dags.py
+++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_dags.py
@@ -188,6 +188,7 @@ class TestGetDagRuns(TestPublicDagEndpoint):
"params_input": {},
"response_received": False,
"assigned_users": [],
+ "created_at": mock.ANY,
}
for i in range(3)
],
diff --git a/airflow-ctl/src/airflowctl/api/datamodels/generated.py b/airflow-ctl/src/airflowctl/api/datamodels/generated.py
index 31da4e13044..739297fd434 100644
--- a/airflow-ctl/src/airflowctl/api/datamodels/generated.py
+++ b/airflow-ctl/src/airflowctl/api/datamodels/generated.py
@@ -1837,6 +1837,7 @@ class HITLDetail(BaseModel):
multiple: Annotated[bool | None, Field(title="Multiple")] = False
params: Annotated[dict[str, Any] | None, Field(title="Params")] = None
assigned_users: Annotated[list[HITLUser] | None, Field(title="Assigned Users")] = None
+ created_at: Annotated[datetime, Field(title="Created At")]
responded_by_user: HITLUser | None = None
responded_at: Annotated[datetime | None, Field(title="Responded At")] = None
chosen_options: Annotated[list[str] | None, Field(title="Chosen Options")] = None
(airflow) 01/07: Dev: Fix another Python 3.13 compat for Prod image tests (#55701)
Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit f300510e1cb10b2a97761fb783a472e903f6b10b
Author: Kaxil Naik <ka...@apache.org>
AuthorDate: Tue Sep 16 01:57:56 2025 +0100
Dev: Fix another Python 3.13 compat for Prod image tests (#55701)
(cherry picked from commit 71fe5b40775801d420779438e94ed2a1f8208ff7)
---
docker-tests/tests/docker_tests/test_prod_image.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docker-tests/tests/docker_tests/test_prod_image.py b/docker-tests/tests/docker_tests/test_prod_image.py
index 3c4bf9528e8..984ab7d0e90 100644
--- a/docker-tests/tests/docker_tests/test_prod_image.py
+++ b/docker-tests/tests/docker_tests/test_prod_image.py
@@ -209,7 +209,8 @@ class TestPythonPackages:
image=default_docker_image,
)
if python_version.startswith("Python 3.13"):
- import_names.remove("airflow.providers.fab")
+ if "airflow.providers.fab" in import_names:
+ import_names.remove("airflow.providers.fab")
run_python_in_docker(f"import {','.join(import_names)}", image=default_docker_image)
def test_there_is_no_opt_airflow_airflow_folder(self, default_docker_image):
(airflow) 06/07: Simplify serve_logs IPv4/v6 binding (#55716)
Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 07768b174be77f9deb0c9a0093d3c4db877f5109
Author: Ash Berlin-Taylor <as...@apache.org>
AuthorDate: Tue Sep 16 14:05:01 2025 +0100
Simplify serve_logs IPv4/v6 binding (#55716)
We were trying to be "smart" about what interface we listened on, but that
isn't really needed, and passing an empty host achieves the same effect:
```
$ netstat -antlp | grep 8793
tcp 0 0 0.0.0.0:8793 0.0.0.0:* LISTEN 85699/airflow serve
tcp6 0 0 :::8793 :::* LISTEN 85699/airflow serve
```
The existing approach was working fine for most people (including myself) it
was working fine and listening on ipv6 and v4 wildcard interfaces as expected,
but some Docker/container set ups this was not the case, and despite Dualstack
saying True, listening on `::` ended up _only_ listening on IPv6, but the
entry in `/etc/hosts` in the container only had an entry for the IPv4 address
of the pod, which we weren't listening on, so log requests would fail.
Which is all a round about way of saying "doing less works better" 😀
(We also don't need the getattr+lambda anymore, as that was to support Python
<= 3.7!)
Fixes #55470
(cherry picked from commit 9ff753d4fb1925c94aee3ae90d7efd0d68423111)
---
airflow-core/src/airflow/utils/serve_logs/core.py | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/airflow-core/src/airflow/utils/serve_logs/core.py b/airflow-core/src/airflow/utils/serve_logs/core.py
index 9f7543d5076..f7dcade8d5f 100644
--- a/airflow-core/src/airflow/utils/serve_logs/core.py
+++ b/airflow-core/src/airflow/utils/serve_logs/core.py
@@ -42,19 +42,15 @@ def serve_logs(port=None):
port = port or conf.getint("logging", "WORKER_LOG_SERVER_PORT")
- # If dual stack is available and IPV6_V6ONLY is not enabled on the socket
- # then when IPV6 is bound to it will also bind to IPV4 automatically
- if getattr(socket, "has_dualstack_ipv6", lambda: False)():
- host = "::" # ASGI uses `::` syntax for IPv6 binding instead of the `[::]` notation used in WSGI, while preserving the `[::]` format in logs
+ if socket.has_dualstack_ipv6():
serve_log_uri = f"http://[::]:{port}"
else:
- host = "0.0.0.0"
- serve_log_uri = f"http://{host}:{port}"
+ serve_log_uri = f"http://0.0.0.0:{port}"
logger.info("Starting log server on %s", serve_log_uri)
# Use uvicorn directly for ASGI applications
- uvicorn.run("airflow.utils.serve_logs.log_server:get_app", host=host, port=port, log_level="info")
+ uvicorn.run("airflow.utils.serve_logs.log_server:get_app", host="", port=port, log_level="info")
# Log serving is I/O bound and has low concurrency, so single process is sufficient