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/14 21:08:19 UTC
(airflow) branch v3-1-test updated (e5e510479d6 -> 38ca6d3409e)
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
from e5e510479d6 Bump trove-classifiers from 2025.9.9.12 to 2025.9.11.17 in /airflow-core (#55606)
new 364547048fd fix(hitl): check whether task instance is deferring when fetching pending actions (#55539)
new 03d75acd4a5 Fix alignment of arrows in RTL mode (#55619)
new 37783d9e301 CI: Bump zizmor hook (#55618)
new 9bbd1cdeb41 Fix xcom access in DAG processor callbacks for notifiers (#55542)
new bf0a9277f9c Fix Dag/TI states names in Hebrew (#55621)
new 6c34a1a53cd Close Dutch translation gaps (2025-09-12) (#55583)
new dd2a83ac56c Allow slash in Variable keys from TaskSDK read/write(#55324)
new 8aaa1330d5f Add missing `.level` property on our structlog shim. (#55638)
new 107c1f70d08 Add documentation for context parameter (#55377)
new 6a51f595d94 Removed unused config: dag_stale_not_seen_duration (#55601)
new 099dda2a66c Improve contrast in Clear Task Instance dialog selectors (#55423)
new 38ca6d3409e Upgrade important versions of dependencies (#55646)
The 12 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 +-
.github/workflows/ci-image-build.yml | 3 +-
.github/workflows/prod-image-build.yml | 3 +-
.pre-commit-config.yaml | 2 +-
Dockerfile.ci | 2 +-
airflow-core/docs/core-concepts/operators.rst | 20 +++-
airflow-core/docs/faq.rst | 1 -
.../src/airflow/api_fastapi/common/parameters.py | 5 +-
.../airflow/api_fastapi/core_api/routes/ui/dags.py | 6 +-
.../api_fastapi/execution_api/routes/variables.py | 15 ++-
.../src/airflow/config_templates/config.yml | 7 --
.../src/airflow/dag_processing/processor.py | 52 ++++++++-
.../src/airflow/jobs/scheduler_job_runner.py | 1 -
.../airflow/ui/public/i18n/locales/he/common.json | 26 ++---
.../ui/public/i18n/locales/he/dashboard.json | 6 +-
.../airflow/ui/public/i18n/locales/nl/admin.json | 2 +-
.../airflow/ui/public/i18n/locales/nl/common.json | 1 +
.../src/airflow/ui/public/i18n/locales/nl/dag.json | 3 +-
.../ui/src/components/NeedsReviewButton.tsx | 5 +-
.../src/airflow/ui/src/components/StatsCard.tsx | 6 +-
.../ui/src/components/ui/SegmentedControl.tsx | 2 +
.../ui/src/layouts/Nav/UserSettingsButton.tsx | 16 ++-
.../src/pages/Dashboard/Stats/DAGImportErrors.tsx | 5 +-
.../airflow/ui/src/pages/Dashboard/Stats/Stats.tsx | 8 +-
.../api_fastapi/core_api/routes/ui/test_dags.py | 3 +-
.../execution_api/versions/head/test_variables.py | 75 ++++++++----
.../tests/unit/dag_processing/test_processor.py | 127 +++++++++++++++++++++
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 | 48 ++++----
.../src/airflow_shared/logging/structlog.py | 13 +--
33 files changed, 365 insertions(+), 108 deletions(-)
(airflow) 09/12: Add documentation for context parameter (#55377)
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 107c1f70d08a9e3b214cc9b3cc7528f9f650fdf7
Author: Karthik S <83...@users.noreply.github.com>
AuthorDate: Sun Sep 14 08:38:57 2025 +0530
Add documentation for context parameter (#55377)
* Update operators.rst
- Clarified usage of the `context` parameter in callables.
- Expanded context variable documentation and examples.
* Update operators.rst
Incorporating feedback. Removing specific examples and adding link to the Context docs. Using typed dict for context.
* Update operators.rst
Added additional syntax
* Update operators.rst
- Clarified usage of the `context` parameter in callables.
- Expanded context variable documentation and examples.
* Update operators.rst
Incorporating feedback. Removing specific examples and adding link to the Context docs. Using typed dict for context.
* Update operators.rst
Added additional syntax
* Update operators.rst
Pushing modifications based on review comments. Removing Git links as they are prone to changes and linking python specific code to its relevant docs on python.
(cherry picked from commit 34b190791c2268f384842dbdcfc781a47ebedd5a)
---
airflow-core/docs/core-concepts/operators.rst | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/airflow-core/docs/core-concepts/operators.rst b/airflow-core/docs/core-concepts/operators.rst
index 256613537b4..2e8b82713d3 100644
--- a/airflow-core/docs/core-concepts/operators.rst
+++ b/airflow-core/docs/core-concepts/operators.rst
@@ -84,11 +84,25 @@ Here, ``{{ ds }}`` is a templated variable, and because the ``env`` parameter of
You can also pass in a callable instead when Python is more readable than a Jinja template. The callable must accept two named arguments ``context`` and ``jinja_env``:
+The ``context`` parameter is an Airflow's ``Context`` object that provides runtime information for the current task execution. Its contents can be accessed with Python's standard `dict syntax <https://docs.python.org/3/library/stdtypes.html#mapping-types-dict>`_. It includes all variables available in Jinja templates and is read-only from the perspective of template rendering - while you can access and use its values, modifications won't affect the task execution environment.
+
+For a complete list of available context variables see :ref:`Templates reference <templates:variables>`.
+
.. code-block:: python
- def build_complex_command(context, jinja_env):
+ from typing import TYPE_CHECKING
+
+ if TYPE_CHECKING:
+ import jinja2
+ from airflow.sdk import Context
+
+
+ def build_complex_command(context: Context, jinja_env: jinja2.Environment) -> str:
+ # Access runtime information from the context dictionary
+ task_id = context["ti"].task_id
+ execution_date = context["ds"]
with open("file.csv") as f:
- return do_complex_things(f)
+ return do_complex_things(f, task_id, execution_date)
t = BashOperator(
@@ -101,7 +115,7 @@ Since each template field is only rendered once, the callable's return value wil
.. code-block:: python
- def build_complex_command(context, jinja_env):
+ def build_complex_command(context: Context, jinja_env: jinja2.Environment) -> str:
with open("file.csv") as f:
data = do_complex_things(f)
return context["task"].render_template(data, context, jinja_env)
(airflow) 06/12: Close Dutch translation gaps (2025-09-12) (#55583)
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 6c34a1a53cd6998f8627597e0dcb037bbad8e358
Author: Vincent Kling <vk...@vinniict.nl>
AuthorDate: Sat Sep 13 18:41:20 2025 +0200
Close Dutch translation gaps (2025-09-12) (#55583)
* Close Dutch translation gaps (2025-09-12)
* fix static checks
(cherry picked from commit f5f3399ed81f0bb32186733e39e9a63adca6131d)
---
airflow-core/src/airflow/ui/public/i18n/locales/nl/admin.json | 2 +-
airflow-core/src/airflow/ui/public/i18n/locales/nl/common.json | 1 +
airflow-core/src/airflow/ui/public/i18n/locales/nl/dag.json | 3 ++-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/nl/admin.json b/airflow-core/src/airflow/ui/public/i18n/locales/nl/admin.json
index 64e0df54c7b..39d3b73bdca 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/nl/admin.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/nl/admin.json
@@ -72,7 +72,7 @@
"tooltip": "Verwijder geselecteerde connecties"
},
"formActions": {
- "save": "Opsalaan"
+ "save": "Opslaan"
},
"plugins": {
"columns": {
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/nl/common.json b/airflow-core/src/airflow/ui/public/i18n/locales/nl/common.json
index 3a03d781d40..3600c32deae 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/nl/common.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/nl/common.json
@@ -39,6 +39,7 @@
"fileLocation": "Bestandslocatie",
"hasTaskConcurrencyLimits": "Heeft Task Concurrency limieten",
"lastExpired": "Laatst verlopen",
+ "lastParseDuration": "Laatste parse duur",
"lastParsed": "Laatst geparsed",
"latestDagVersion": "Laatste Dag versie",
"latestRun": "Laatste Run",
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/nl/dag.json b/airflow-core/src/airflow/ui/public/i18n/locales/nl/dag.json
index 07a30b10bbf..ad1a937e6af 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/nl/dag.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/nl/dag.json
@@ -35,7 +35,8 @@
"code": {
"bundleUrl": "Bundle URL",
"noCode": "Geen code gevonden",
- "parsedAt": "Parsed at:"
+ "parseDuration": "Parse duur:",
+ "parsedAt": "Geparsed op:"
},
"extraLinks": "Extra Links",
"grid": {
(airflow) 02/12: Fix alignment of arrows in RTL mode (#55619)
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 03d75acd4a561cfc8cf4832dec263a5ef07d20f1
Author: Shahar Epstein <60...@users.noreply.github.com>
AuthorDate: Sat Sep 13 11:29:06 2025 +0300
Fix alignment of arrows in RTL mode (#55619)
(cherry picked from commit 7d02b8528892533550d35e0e367f6101c81d9292)
---
.../src/airflow/ui/src/components/NeedsReviewButton.tsx | 5 ++++-
airflow-core/src/airflow/ui/src/components/StatsCard.tsx | 6 ++++--
.../airflow/ui/src/layouts/Nav/UserSettingsButton.tsx | 16 +++++++++++++---
.../ui/src/pages/Dashboard/Stats/DAGImportErrors.tsx | 5 ++++-
.../src/airflow/ui/src/pages/Dashboard/Stats/Stats.tsx | 8 +++++++-
5 files changed, 32 insertions(+), 8 deletions(-)
diff --git a/airflow-core/src/airflow/ui/src/components/NeedsReviewButton.tsx b/airflow-core/src/airflow/ui/src/components/NeedsReviewButton.tsx
index 646bca0bca6..78b246f3e36 100644
--- a/airflow-core/src/airflow/ui/src/components/NeedsReviewButton.tsx
+++ b/airflow-core/src/airflow/ui/src/components/NeedsReviewButton.tsx
@@ -41,7 +41,9 @@ export const NeedsReviewButton = ({
});
const hitlTIsCount = hitlStatsData?.hitl_details.length ?? 0;
- const { t: translate } = useTranslation("hitl");
+ const { i18n, t: translate } = useTranslation("hitl");
+
+ const isRTL = i18n.dir() === "rtl";
return hitlTIsCount > 0 ? (
<Box maxW="250px">
@@ -50,6 +52,7 @@ export const NeedsReviewButton = ({
count={hitlTIsCount}
icon={<LuUserRoundPen />}
isLoading={isLoading}
+ isRTL={isRTL}
label={translate("requiredAction_other")}
link="required_actions?response_received=false"
/>
diff --git a/airflow-core/src/airflow/ui/src/components/StatsCard.tsx b/airflow-core/src/airflow/ui/src/components/StatsCard.tsx
index 7d7bf9c14b4..cbade7d249d 100644
--- a/airflow-core/src/airflow/ui/src/components/StatsCard.tsx
+++ b/airflow-core/src/airflow/ui/src/components/StatsCard.tsx
@@ -17,7 +17,7 @@
* under the License.
*/
import { Box, HStack, Skeleton, Text } from "@chakra-ui/react";
-import { FiChevronRight } from "react-icons/fi";
+import { FiChevronRight, FiChevronLeft } from "react-icons/fi";
import { Link as RouterLink } from "react-router-dom";
import type { TaskInstanceState } from "openapi/requests/types.gen";
@@ -28,6 +28,7 @@ export const StatsCard = ({
count,
icon,
isLoading = false,
+ isRTL,
label,
link,
onClick,
@@ -37,6 +38,7 @@ export const StatsCard = ({
readonly count: number;
readonly icon?: React.ReactNode;
readonly isLoading?: boolean;
+ readonly isRTL: boolean;
readonly label: string;
readonly link?: string;
readonly onClick?: () => void;
@@ -63,7 +65,7 @@ export const StatsCard = ({
<Text color="fg" fontSize="sm" fontWeight="bold">
{label}
</Text>
- <FiChevronRight size={16} />
+ {isRTL ? <FiChevronLeft size={16} /> : <FiChevronRight size={16} />}
</HStack>
);
diff --git a/airflow-core/src/airflow/ui/src/layouts/Nav/UserSettingsButton.tsx b/airflow-core/src/airflow/ui/src/layouts/Nav/UserSettingsButton.tsx
index a2b99016d91..c8cc8108945 100644
--- a/airflow-core/src/airflow/ui/src/layouts/Nav/UserSettingsButton.tsx
+++ b/airflow-core/src/airflow/ui/src/layouts/Nav/UserSettingsButton.tsx
@@ -27,6 +27,7 @@ import {
FiGlobe,
FiEye,
FiChevronRight,
+ FiChevronLeft,
FiMonitor,
} from "react-icons/fi";
import { MdOutlineAccountTree } from "react-icons/md";
@@ -52,7 +53,7 @@ const COLOR_MODES = {
type ColorMode = (typeof COLOR_MODES)[keyof typeof COLOR_MODES];
export const UserSettingsButton = ({ externalViews }: { readonly externalViews: Array<NavItemResponse> }) => {
- const { t: translate } = useTranslation();
+ const { i18n, t: translate } = useTranslation();
const { selectedTheme, setColorMode } = useColorMode();
const { onClose: onCloseTimezone, onOpen: onOpenTimezone, open: isOpenTimezone } = useDisclosure();
const { onClose: onCloseLogout, onOpen: onOpenLogout, open: isOpenLogout } = useDisclosure();
@@ -61,6 +62,8 @@ export const UserSettingsButton = ({ externalViews }: { readonly externalViews:
const theme = selectedTheme ?? COLOR_MODES.SYSTEM;
+ const isRTL = i18n.dir() === "rtl";
+
return (
<Menu.Root positioning={{ placement: "right" }}>
<Menu.Trigger asChild>
@@ -75,7 +78,11 @@ export const UserSettingsButton = ({ externalViews }: { readonly externalViews:
<Menu.TriggerItem>
<FiEye size="1.25rem" style={{ marginRight: "8px" }} />
{translate("appearance.appearance")}
- <FiChevronRight size="1.25rem" style={{ marginLeft: "auto" }} />
+ {isRTL ? (
+ <FiChevronLeft size="1.25rem" style={{ marginRight: "auto" }} />
+ ) : (
+ <FiChevronRight size="1.25rem" style={{ marginLeft: "auto" }} />
+ )}
</Menu.TriggerItem>
<Menu.Content>
<Menu.RadioItemGroup
@@ -121,7 +128,10 @@ export const UserSettingsButton = ({ externalViews }: { readonly externalViews:
<PluginMenuItem {...view} key={view.name} />
))}
<Menu.Item onClick={onOpenLogout} value="logout">
- <FiLogOut size="1.25rem" style={{ marginRight: "8px" }} />
+ <FiLogOut
+ size="1.25rem"
+ style={{ marginRight: "8px", transform: isRTL ? "rotate(180deg)" : undefined }}
+ />
{translate("logout")}
</Menu.Item>
</Menu.Content>
diff --git a/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrors.tsx b/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrors.tsx
index 079472cf353..2966fee23cd 100644
--- a/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrors.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/DAGImportErrors.tsx
@@ -29,7 +29,9 @@ import { DAGImportErrorsModal } from "./DAGImportErrorsModal";
export const DAGImportErrors = ({ iconOnly = false }: { readonly iconOnly?: boolean }) => {
const { onClose, onOpen, open } = useDisclosure();
- const { t: translate } = useTranslation("dashboard");
+ const { i18n, t: translate } = useTranslation("dashboard");
+
+ const isRTL = i18n.dir() === "rtl";
const { data, error, isLoading } = useImportErrorServiceGetImportErrors();
const importErrorsCount = data?.total_entries ?? 0;
@@ -63,6 +65,7 @@ export const DAGImportErrors = ({ iconOnly = false }: { readonly iconOnly?: bool
count={importErrorsCount}
icon={<LuFileWarning />}
isLoading={isLoading}
+ isRTL={isRTL}
label={translate("importErrors.dagImportError", { count: importErrorsCount })}
onClick={onOpen}
/>
diff --git a/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/Stats.tsx b/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/Stats.tsx
index b766cd12b4f..5cfc7b2d7c2 100644
--- a/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/Stats.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Dashboard/Stats/Stats.tsx
@@ -38,7 +38,9 @@ export const Stats = () => {
const queuedDagsCount = statsData?.queued_dag_count ?? 0;
const runningDagsCount = statsData?.running_dag_count ?? 0;
const activeDagsCount = statsData?.active_dag_count ?? 0;
- const { t: translate } = useTranslation("dashboard");
+ const { i18n, t: translate } = useTranslation("dashboard");
+
+ const isRTL = i18n.dir() === "rtl";
return (
<Box>
@@ -56,6 +58,7 @@ export const Stats = () => {
colorScheme="failed"
count={failedDagsCount}
isLoading={isStatsLoading}
+ isRTL={isRTL}
label={translate("stats.failedDags")}
link="dags?last_dag_run_state=failed"
state="failed"
@@ -70,6 +73,7 @@ export const Stats = () => {
colorScheme="queued"
count={queuedDagsCount}
isLoading={isStatsLoading}
+ isRTL={isRTL}
label={translate("stats.queuedDags")}
link="dags?last_dag_run_state=queued"
state="queued"
@@ -80,6 +84,7 @@ export const Stats = () => {
colorScheme="running"
count={runningDagsCount}
isLoading={isStatsLoading}
+ isRTL={isRTL}
label={translate("stats.runningDags")}
link="dags?last_dag_run_state=running"
state="running"
@@ -90,6 +95,7 @@ export const Stats = () => {
count={activeDagsCount}
icon={<FiZap />}
isLoading={isStatsLoading}
+ isRTL={isRTL}
label={translate("stats.activeDags")}
link="dags?paused=false"
/>
(airflow) 08/12: Add missing `.level` property on our structlog shim. (#55638)
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 8aaa1330d5f6c6ca2f8d852792ff729f91b462ed
Author: Ash Berlin-Taylor <as...@apache.org>
AuthorDate: Sun Sep 14 03:56:53 2025 +0100
Add missing `.level` property on our structlog shim. (#55638)
This wasn't caught in unit tests, but it was reported that something within
Slack's python library itself is trying to access this property.
https://github.com/slackapi/python-slack-sdk/blob/ed1893d/slack_sdk/socket_mode/client.py#L98
for example
(cherry picked from commit ee99c6238375494cb226f3019452ac369e0cde92)
---
shared/logging/src/airflow_shared/logging/structlog.py | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/shared/logging/src/airflow_shared/logging/structlog.py b/shared/logging/src/airflow_shared/logging/structlog.py
index bc381dfbc7d..37b65cca1d8 100644
--- a/shared/logging/src/airflow_shared/logging/structlog.py
+++ b/shared/logging/src/airflow_shared/logging/structlog.py
@@ -70,11 +70,9 @@ def _make_airflow_structlogger(min_level):
def handlers(self):
return [logging.NullHandler()]
- def isEnabledFor(self: Any, level):
- return self.is_enabled_for(level)
-
- def getEffectiveLevel(self: Any):
- return self.get_effective_level()
+ @property
+ def level(self):
+ return min_level
@property
def name(self):
@@ -109,8 +107,9 @@ def _make_airflow_structlogger(min_level):
f"AirflowBoundLoggerFilteringAt{LEVEL_TO_NAME.get(min_level, 'Notset').capitalize()}",
(base,),
{
- "isEnabledFor": isEnabledFor,
- "getEffectiveLevel": getEffectiveLevel,
+ "isEnabledFor": base.is_enabled_for,
+ "getEffectiveLevel": base.get_effective_level,
+ "level": level,
"name": name,
"handlers": handlers,
}
(airflow) 01/12: fix(hitl): check whether task instance is deferring when fetching pending actions (#55539)
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 364547048fd302e79c91b29ac68db18258187415
Author: Wei Lee <we...@gmail.com>
AuthorDate: Sat Sep 13 07:13:41 2025 +0800
fix(hitl): check whether task instance is deferring when fetching pending actions (#55539)
(cherry picked from commit 81cfe3db827b093c413e8d2be9a1e74d1b2e7fb5)
---
airflow-core/src/airflow/api_fastapi/common/parameters.py | 5 ++++-
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py | 6 +++++-
airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_dags.py | 3 ++-
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/airflow-core/src/airflow/api_fastapi/common/parameters.py b/airflow-core/src/airflow/api_fastapi/common/parameters.py
index f1d876f29b6..7a555454cd1 100644
--- a/airflow-core/src/airflow/api_fastapi/common/parameters.py
+++ b/airflow-core/src/airflow/api_fastapi/common/parameters.py
@@ -718,7 +718,10 @@ class _PendingActionsFilter(BaseParam[bool]):
pending_actions_count_subquery = (
sql_select(func.count(HITLDetail.ti_id))
.join(TaskInstance, HITLDetail.ti_id == TaskInstance.id)
- .where(HITLDetail.response_at.is_(None))
+ .where(
+ HITLDetail.response_at.is_(None),
+ TaskInstance.state == TaskInstanceState.DEFERRED,
+ )
.where(TaskInstance.dag_id == DagModel.dag_id)
.scalar_subquery()
)
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py
index e953017a56b..9cd5698800a 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/dags.py
@@ -67,6 +67,7 @@ from airflow.api_fastapi.core_api.security import (
from airflow.models import DagModel, DagRun
from airflow.models.hitl import HITLDetail
from airflow.models.taskinstance import TaskInstance
+from airflow.utils.state import TaskInstanceState
dags_router = AirflowRouter(prefix="/dags", tags=["DAG"])
@@ -201,7 +202,10 @@ def get_dags(
HITLDetail,
)
.join(TaskInstance, HITLDetail.ti_id == TaskInstance.id)
- .where(HITLDetail.response_at.is_(None))
+ .where(
+ HITLDetail.response_at.is_(None),
+ TaskInstance.state == TaskInstanceState.DEFERRED,
+ )
.where(TaskInstance.dag_id.in_([dag.dag_id for dag in dags]))
.order_by(TaskInstance.dag_id)
)
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 f85d7bda49b..ea1f6293151 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
@@ -29,7 +29,7 @@ from airflow.models import DagRun
from airflow.models.hitl import HITLDetail
from airflow.sdk.timezone import utcnow
from airflow.utils.session import provide_session
-from airflow.utils.state import DagRunState
+from airflow.utils.state import DagRunState, TaskInstanceState
from airflow.utils.types import DagRunTriggeredByType, DagRunType
from unit.api_fastapi.core_api.routes.public.test_dags import (
@@ -136,6 +136,7 @@ class TestGetDagRuns(TestPublicDagEndpoint):
run_id=f"hitl_run_{ti_i}",
task_id=f"test_task_{ti_i}",
session=session,
+ state=TaskInstanceState.DEFERRED,
)
for ti_i in range(TI_COUNT)
]
(airflow) 12/12: Upgrade important versions of dependencies (#55646)
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 38ca6d3409ee1169b986b425074771ab2a79cd4f
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Sun Sep 14 13:55:15 2025 +0000
Upgrade important versions of dependencies (#55646)
(cherry picked from commit d455c826593b8c3cca9d9a2c6c808df02590aa83)
---
.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 | 48 +++++++++++-----------
7 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/.github/actions/install-prek/action.yml b/.github/actions/install-prek/action.yml
index 1ce7b15f39b..cacd19f9639 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.1.6" # Keep this comment to allow automatic replacement of prek version
+ default: "0.2.0" # 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 8c0e2e44689..a9e8d05bec7 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.1.6"
+ARG AIRFLOW_PREK_VERSION="0.2.0"
# 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 fd255fd89f1..1972ba120e6 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: 85824868b3ba0b7a43509b65f87150d872d2e2f50fea09872d37c9d1e0207ae3084072fb126ba5ebc314c83d86fa17e026630ee3253ddd44a0e139d3f9f1e281
+Package config hash: 69dbe16e1e5cd15584658d419c1d2b5605ebeb0d264acc525563a23aaeea82ed15dd61b2ce292a1bec408cae112378960b39f6ee4aa0b1341e35d2ca6ad47351
---------------------------------------------------------------------------------------------------------
diff --git a/dev/breeze/doc/ci/02_images.md b/dev/breeze/doc/ci/02_images.md
index f908748d8af..208fe14699e 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.1.6` | `prek` version used. |
+| `AIRFLOW_PREK_VERSION` | `0.2.0` | `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 abf0159ec85..82a65725b67 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.1.6",
+ "prek>=0.2.0",
"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 ae548fcb626..d1330fa57f4 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.1.6"
+PREK_VERSION = "0.2.0"
HATCH_VERSION = "1.14.1"
PYYAML_VERSION = "6.0.2"
diff --git a/dev/breeze/uv.lock b/dev/breeze/uv.lock
index 7301c56db81..580132093fb 100644
--- a/dev/breeze/uv.lock
+++ b/dev/breeze/uv.lock
@@ -1,5 +1,5 @@
version = 1
-revision = 2
+revision = 3
requires-python = ">=3.10, !=3.13"
resolution-markers = [
"python_full_version >= '3.13'",
@@ -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.1.6" },
+ { name = "prek", specifier = ">=0.2.0" },
{ 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.1.6"
-source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/77/29/99625bf6570b64b0d63f4ee6c3be939bbdaa64a842bab8e4e702a83f9946/prek-0.1.6.tar.gz", hash = "sha256:ceb193fa12235c448514e91c0d5ee94e47c48941cd20d7242c7a2031f9cc3b2e", size = 195662, upload-time = "2025-09-03T12:09:01.501Z" }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/c7/cb/46a7d29b5e250231afcf399c799cda9ead421712f9f343d26f2d43cf4d53/prek-0.1.6-py3-none-linux_armv6l.whl", hash = "sha256:cb06b7c1cb876382344995b19ce4df05d18bd9cc21b84905fae9953765f7fdfe", size = 5479888, upload-time = "2025-09-03T12:08:33.342Z" },
- { url = "https://files.pythonhosted.org/packages/5e/85/fcaa6fbb1a28e8df1b184f0a5a7d2fa529258f1ced83b5cea041f0ecb055/prek-0.1.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:88ea43afd30f13c99ca6d493f0a277b0234a3411be1dacdf7a1e96d6e41bbfca", size = 5463396, upload-time = "2025-09-03T12:08:35.056Z" },
- { url = "https://files.pythonhosted.org/packages/52/1d/ce17324f500fdc78e5462a982806da253f641b07ffdf5ec7da2d8b316d94/prek-0.1.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e446c91ce04126467753ff21dffc13c263689f2626251993feb32176f829cfdc", size = 5268164, upload-time = "2025-09-03T12:08:36.683Z" },
- { url = "https://files.pythonhosted.org/packages/ce/22/a9a063587d1b8b1f5298771f29da38e4b3138a8eb33801b58958c0c934ff/prek-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl", hash = "sha256:49b7307f6795ba3a3b4b7f7d4821e168148854541786dfeaf481074f941858e0", size = 5647952, upload-time = "2025-09-03T12:08:38.124Z" },
- { url = "https://files.pythonhosted.org/packages/5d/10/0b00b92974ae5e03115382f1e20803baf2f5b799ae89768e8c3a406daa2e/prek-0.1.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5880499d304eda6d9f099cba976b922fe3441040112fc868171e885c4e14f4c5", size = 5389501, upload-time = "2025-09-03T12:08:39.496Z" },
- { url = "https://files.pythonhosted.org/packages/04/ea/0a89b20b5d0d20841dcf52ff4d65a8be512013137830dd691ed0b27edb39/prek-0.1.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2fb15e00613492073ce64c016768d30580839d62812623a70d9e870402603361", size = 6050426, upload-time = "2025-09-03T12:08:41.066Z" },
- { url = "https://files.pythonhosted.org/packages/5b/29/bd3c45199d7a5ab653990229c30a5e2b266c9a6732b7b6c8f057603bd2bd/prek-0.1.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:376c5c6fb5e9d7faa2ccea55e9791e8af8ceb96679aedb52363f48e879dc38fa", size = 6615182, upload-time = "2025-09-03T12:08:43.676Z" },
- { url = "https://files.pythonhosted.org/packages/12/ad/d49d061c8d829fe0bc47db0e1d483ed42430ec88ea71d3acfd3ea83690e8/prek-0.1.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7d3b9ebbf8d3d275d30513e4477f19845434f519d2f0ef230bebbf9f4c0cb156", size = 6380740, upload-time = "2025-09-03T12:08:45.051Z" },
- { url = "https://files.pythonhosted.org/packages/11/c2/ed4feba7cd5f7426a1f68a997c487dea38eb6fabed86e18b5b007a1f695b/prek-0.1.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:38f318458673578cd4ca28079881d5d3b7e5630a4b6fa24ef97da2398d9eac95", size = 5842265, upload-time = "2025-09-03T12:08:46.416Z" },
- { url = "https://files.pythonhosted.org/packages/36/06/1925768b33e5e7b9fa039164dc44e43de47c0ecd548457a3d83453c7c201/prek-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:59d22a6f8a7908223bc9c5e1dda004ec9f7f24adef0f8747b9d09d63b206647d", size = 5822255, upload-time = "2025-09-03T12:08:47.987Z" },
- { url = "https://files.pythonhosted.org/packages/8b/41/c8d2682ccb5015eea10943802c341ffd808c1890c4030b7ef36f22120912/prek-0.1.6-py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:3df1705d07c951da47105d9d13e985792094cd068841bc0b4a88001c65181a43", size = 5675825, upload-time = "2025-09-03T12:08:49.235Z" },
- { url = "https://files.pythonhosted.org/packages/53/02/7ace9dcf2b74f4423733a3c60dbc8b32b1205372bb39d141eb11cfe842ab/prek-0.1.6-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:09071cc2a4b5d30dbe369e9259378439d1fa1c03534e50afae9f94cbee4c567c", size = 5739031, upload-time = "2025-09-03T12:08:50.581Z" },
- { url = "https://files.pythonhosted.org/packages/09/85/dad0ef6fd9c3186a928ecbfc858e48fa11b6b7c1bb6b55c9cf29e406ddea/prek-0.1.6-py3-none-musllinux_1_1_armv7l.whl", hash = "sha256:26a184108ebe5e3db36bedac9d50d61c690207754aaf58205cd2afea93983509", size = 5408159, upload-time = "2025-09-03T12:08:52.137Z" },
- { url = "https://files.pythonhosted.org/packages/6c/70/6c66edc0b27780927bd5e8729f382c5a1ba87d68c30ffc1b7058c81c2730/prek-0.1.6-py3-none-musllinux_1_1_i686.whl", hash = "sha256:59f3f9606d7a065b520fc06d54cf09f27d627afcfd1222206947119d2c3337bf", size = 5758070, upload-time = "2025-09-03T12:08:53.66Z" },
- { url = "https://files.pythonhosted.org/packages/6f/f4/166071db1e3eb5a18c3b2c41a73b664c7e16bf0ef6d8d819d15756046359/prek-0.1.6-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:0a31c0fe23d5bc0eabd2222cdd2efb085cf306422d594433e20fd13606919c1a", size = 5905007, upload-time = "2025-09-03T12:08:55.415Z" },
- { url = "https://files.pythonhosted.org/packages/8f/c3/cdeb71b0e3bb4788482548bd1b3f2c080e2a3f8fbe043f1da68e8f92951e/prek-0.1.6-py3-none-win32.whl", hash = "sha256:61ec7db7dadd70ea5ac4a06145598cd88d4518278e0addfed49f5fec92fd3c3d", size = 4233887, upload-time = "2025-09-03T12:08:56.634Z" },
- { url = "https://files.pythonhosted.org/packages/e7/f5/31e515cc9c7cbfbc4af122b77fa7457efaacf2d6c6fc17ca9bcb47155b98/prek-0.1.6-py3-none-win_amd64.whl", hash = "sha256:ab80c81dac48ec53fe8670273248b7044e18bc2012b07241dbcada14b8a057fd", size = 4741942, upload-time = "2025-09-03T12:08:58.717Z" },
- { url = "https://files.pythonhosted.org/packages/e3/18/c52d5ae8235710688a561140884166265787670801ae30e1a691cbec163f/prek-0.1.6-py3-none-win_arm64.whl", hash = "sha256:424fdb239204e48724cc3c9690493bebac0e8c071d79fa6e0204573c36f42425", size = 4500561, upload-time = "2025-09-03T12:09:00.333Z" },
+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" },
]
[[package]]
(airflow) 10/12: Removed unused config: dag_stale_not_seen_duration (#55601)
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 6a51f595d94f57fcdca1fb18df2e8a953c5f4034
Author: Niko Oliveira <on...@amazon.com>
AuthorDate: Sat Sep 13 20:17:37 2025 -0700
Removed unused config: dag_stale_not_seen_duration (#55601)
This config was used by the scheduler for the stale dag removal process.
That process was removed from the scheduler in #47304 but these traces of
the config were left behind.
(cherry picked from commit f3b4dc6cf1970c98e0318879711df1cb0bbeb8cf)
---
airflow-core/docs/faq.rst | 1 -
airflow-core/src/airflow/config_templates/config.yml | 7 -------
airflow-core/src/airflow/jobs/scheduler_job_runner.py | 1 -
3 files changed, 9 deletions(-)
diff --git a/airflow-core/docs/faq.rst b/airflow-core/docs/faq.rst
index 00673a8e5f7..f57f2ddebf2 100644
--- a/airflow-core/docs/faq.rst
+++ b/airflow-core/docs/faq.rst
@@ -227,7 +227,6 @@ There are several reasons why Dags might disappear from the UI. Common causes in
* :ref:`config:dag_processor__file_parsing_sort_mode` - Ensure sorting method matches your sync strategy
* :ref:`config:dag_processor__parsing_processes` - Number of parallel parsers
* :ref:`config:scheduler__parsing_cleanup_interval` - Controls stale Dag cleanup frequency
- * :ref:`config:scheduler__dag_stale_not_seen_duration` - Time threshold for marking Dags as stale
* **File synchronization problems** - Common with git-sync setups:
diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml
index 5da744041a2..b3bc911e1d8 100644
--- a/airflow-core/src/airflow/config_templates/config.yml
+++ b/airflow-core/src/airflow/config_templates/config.yml
@@ -2158,13 +2158,6 @@ scheduler:
type: integer
default: "20"
see_also: ":ref:`scheduler:ha:tunables`"
- dag_stale_not_seen_duration:
- description: |
- Time in seconds after which dags, which were not updated by Dag Processor are deactivated.
- version_added: 2.4.0
- type: integer
- example: ~
- default: "600"
use_job_schedule:
description: |
Turn off scheduler use of cron intervals by setting this to ``False``.
diff --git a/airflow-core/src/airflow/jobs/scheduler_job_runner.py b/airflow-core/src/airflow/jobs/scheduler_job_runner.py
index 5d918704736..7dd38519648 100644
--- a/airflow-core/src/airflow/jobs/scheduler_job_runner.py
+++ b/airflow-core/src/airflow/jobs/scheduler_job_runner.py
@@ -198,7 +198,6 @@ class SchedulerJobRunner(BaseJobRunner, LoggingMixin):
self._task_instance_heartbeat_timeout_secs = conf.getint(
"scheduler", "task_instance_heartbeat_timeout"
)
- self._dag_stale_not_seen_duration = conf.getint("scheduler", "dag_stale_not_seen_duration")
self._task_queued_timeout = conf.getfloat("scheduler", "task_queued_timeout")
self._enable_tracemalloc = conf.getboolean("scheduler", "enable_tracemalloc")
(airflow) 05/12: Fix Dag/TI states names in Hebrew (#55621)
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 bf0a9277f9ca95d7076af854be2ee6ee2f7fdc93
Author: Shahar Epstein <60...@users.noreply.github.com>
AuthorDate: Sat Sep 13 16:08:41 2025 +0300
Fix Dag/TI states names in Hebrew (#55621)
(cherry picked from commit d1816e904d78d04065727916a312b65642a3ee6e)
---
.../airflow/ui/public/i18n/locales/he/common.json | 26 +++++++++++-----------
.../ui/public/i18n/locales/he/dashboard.json | 6 ++---
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/he/common.json b/airflow-core/src/airflow/ui/public/i18n/locales/he/common.json
index 1f7ce99a950..50c60812b33 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/he/common.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/he/common.json
@@ -144,13 +144,13 @@
"taskInstance": "הערת משימה"
},
"pools": {
- "deferred": "נדחה לתזמון עתידי",
+ "deferred": "בהשהייה",
"open": "פתוח",
"pools_one": "מאגר משאבים",
"pools_other": "מאגרי משאבים",
"pools_two": "מאגרי משאבים",
"queued": "בתור",
- "running": "בביצוע",
+ "running": "בריצה",
"scheduled": "מתוזמן"
},
"reset": "אתחל",
@@ -189,20 +189,20 @@
"startDate": "תאריך התחלה",
"state": "מצב",
"states": {
- "deferred": "נדחה",
- "failed": "נכשל",
+ "deferred": "בהשהייה",
+ "failed": "נכשלו",
"no_status": "ללא סטטוס",
"none": "ללא סטטוס",
- "planned": "מתוכנן",
+ "planned": "בתכנון",
"queued": "בתור",
- "removed": "הוסר",
- "restarting": "מופעל מחדש",
- "running": "בביצוע",
- "scheduled": "מתוזמן",
- "skipped": "דולג",
- "success": "הצליח",
- "up_for_reschedule": "ממתין לתזמון מחדש",
- "up_for_retry": "ממתין לניסיון חוזר",
+ "removed": "הוסרו",
+ "restarting": "בהפעלה מחדש",
+ "running": "בריצה",
+ "scheduled": "בתזמון",
+ "skipped": "דולגו",
+ "success": "הצליחו",
+ "up_for_reschedule": "בהמתנה לתזמון מחדש",
+ "up_for_retry": "בהמתנה לניסיון חוזר",
"upstream_failed": "משימות קודמות נכשלו"
},
"table": {
diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/he/dashboard.json b/airflow-core/src/airflow/ui/public/i18n/locales/he/dashboard.json
index 7f962b05ceb..304b985f64f 100644
--- a/airflow-core/src/airflow/ui/public/i18n/locales/he/dashboard.json
+++ b/airflow-core/src/airflow/ui/public/i18n/locales/he/dashboard.json
@@ -8,7 +8,7 @@
},
"group": "קבוצה",
"health": {
- "dagProcessor": "Dag מנתח",
+ "dagProcessor": "מנתח Dags",
"health": "תקינות",
"healthy": "תקין",
"lastHeartbeat": "פעימה אחרונה",
@@ -35,8 +35,8 @@
},
"source": "מקור",
"stats": {
- "activeDags": "Dags פעיל",
- "failedDags": "Dags בכשלון",
+ "activeDags": "Dags פעילים",
+ "failedDags": "Dags נכשלו",
"queuedDags": "Dags בתור",
"requiredActions": "פעולות נדרשות",
"runningDags": "Dags בריצה",
(airflow) 03/12: CI: Bump zizmor hook (#55618)
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 37783d9e30157a27a2b4ee58e4c87181f0256531
Author: GPK <go...@gmail.com>
AuthorDate: Sat Sep 13 10:40:13 2025 +0100
CI: Bump zizmor hook (#55618)
* Bump zizmor hook
* Fix zizmor findings
* Fix zizmor findings
(cherry picked from commit 2c057bd528f856e8afb6b4f27c6c3bffecad1a88)
---
.github/workflows/ci-image-build.yml | 3 ++-
.github/workflows/prod-image-build.yml | 3 ++-
.pre-commit-config.yaml | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/ci-image-build.yml b/.github/workflows/ci-image-build.yml
index b7e09a38648..6fc2c4e9bf6 100644
--- a/.github/workflows/ci-image-build.yml
+++ b/.github/workflows/ci-image-build.yml
@@ -72,6 +72,7 @@ on: # yamllint disable-line rule:truthy
description: "JSON-formatted array of Python versions to build images from"
required: true
type: string
+ default: '[""]'
branch:
description: "Branch used to run the CI jobs in (main/v*_*_test)."
required: true
@@ -99,7 +100,7 @@ jobs:
strategy:
fail-fast: true
matrix:
- python-version: ${{ fromJSON(inputs.python-versions) || fromJSON('[""]') }}
+ python-version: ${{ fromJSON(inputs.python-versions) }}
timeout-minutes: 110
name: "Build CI ${{ inputs.platform }} image ${{ matrix.python-version }}"
runs-on: ${{ fromJSON(inputs.runners) }}
diff --git a/.github/workflows/prod-image-build.yml b/.github/workflows/prod-image-build.yml
index 31127a8e132..292d0d37fe3 100644
--- a/.github/workflows/prod-image-build.yml
+++ b/.github/workflows/prod-image-build.yml
@@ -76,6 +76,7 @@ on: # yamllint disable-line rule:truthy
description: "JSON-formatted array of Python versions to build images from"
required: true
type: string
+ default: '[""]'
default-python-version:
description: "Which version of python should be used by default"
required: true
@@ -184,7 +185,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- python-version: ${{ fromJSON(inputs.python-versions) || fromJSON('[""]') }}
+ python-version: ${{ fromJSON(inputs.python-versions) }}
timeout-minutes: 80
name: "Build PROD ${{ inputs.build-type }} image ${{ matrix.python-version }}"
runs-on: ${{ fromJSON(inputs.runners) }}
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d9dd6131a09..93a75476896 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -355,7 +355,7 @@ repos:
- --skip=providers/.*/src/airflow/providers/*/*.rst,providers/*/docs/changelog.rst,docs/*/commits.rst,providers/*/docs/commits.rst,providers/*/*/docs/commits.rst,docs/apache-airflow/tutorial/pipeline_example.csv,*.min.js,*.lock,INTHEWILD.md,*.svg
- --exclude-file=.codespellignorelines
- repo: https://github.com/woodruffw/zizmor-pre-commit
- rev: 5fee7cc03a2498e0ce36a18f36dfb558a30a426c # frozen: v1.12.1
+ rev: b933184438555436e38621f46ceb0c417cbed400 # frozen: v1.13.0
hooks:
- id: zizmor
name: Run zizmor to check for github workflow syntax errors
(airflow) 11/12: Improve contrast in Clear Task Instance dialog selectors (#55423)
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 099dda2a66cecd02a8938e6b5566ae38e93a487a
Author: Dheeraj Turaga <dh...@gmail.com>
AuthorDate: Sun Sep 14 00:46:07 2025 -0500
Improve contrast in Clear Task Instance dialog selectors (#55423)
(cherry picked from commit 573a24720ce2bf951caaaeae1f05d84be96261f0)
---
airflow-core/src/airflow/ui/src/components/ui/SegmentedControl.tsx | 2 ++
1 file changed, 2 insertions(+)
diff --git a/airflow-core/src/airflow/ui/src/components/ui/SegmentedControl.tsx b/airflow-core/src/airflow/ui/src/components/ui/SegmentedControl.tsx
index bb0a6b50df0..3ab69b4065e 100644
--- a/airflow-core/src/airflow/ui/src/components/ui/SegmentedControl.tsx
+++ b/airflow-core/src/airflow/ui/src/components/ui/SegmentedControl.tsx
@@ -61,6 +61,8 @@ const SegmentedControl = ({ defaultValues, multiple = false, onChange, options }
<Button
_hover={{ backgroundColor: "bg.emphasized" }}
bg={selectedOptions.includes(value) ? "bg.panel" : undefined}
+ borderColor={selectedOptions.includes(value) ? "border.emphasized" : "transparent"}
+ borderWidth={selectedOptions.includes(value) ? 1 : 0}
disabled={disabled}
key={value}
onClick={() => onClick(value)}
(airflow) 04/12: Fix xcom access in DAG processor callbacks for notifiers (#55542)
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 9bbd1cdeb41c45415dd55fdeb2cbc7eefaaf17c2
Author: Amogh Desai <am...@gmail.com>
AuthorDate: Sat Sep 13 06:39:04 2025 -0600
Fix xcom access in DAG processor callbacks for notifiers (#55542)
(cherry picked from commit ba120e2db157c5b26c8ac7e0ada643333ebecae0)
---
.../src/airflow/dag_processing/processor.py | 52 ++++++++-
.../tests/unit/dag_processing/test_processor.py | 127 +++++++++++++++++++++
2 files changed, 177 insertions(+), 2 deletions(-)
diff --git a/airflow-core/src/airflow/dag_processing/processor.py b/airflow-core/src/airflow/dag_processing/processor.py
index d4c73e61fea..616bd1abbe9 100644
--- a/airflow-core/src/airflow/dag_processing/processor.py
+++ b/airflow-core/src/airflow/dag_processing/processor.py
@@ -44,12 +44,20 @@ from airflow.sdk.execution_time.comms import (
GetPreviousDagRun,
GetPrevSuccessfulDagRun,
GetVariable,
+ GetXCom,
+ GetXComCount,
+ GetXComSequenceItem,
+ GetXComSequenceSlice,
MaskSecret,
OKResponse,
PreviousDagRunResult,
PrevSuccessfulDagRunResult,
PutVariable,
VariableResult,
+ XComCountResponse,
+ XComResult,
+ XComSequenceIndexResult,
+ XComSequenceSliceResult,
)
from airflow.sdk.execution_time.supervisor import WatchedSubprocess
from airflow.sdk.execution_time.task_runner import RuntimeTaskInstance, _send_task_error_email
@@ -107,6 +115,10 @@ ToManager = Annotated[
| DeleteVariable
| GetPrevSuccessfulDagRun
| GetPreviousDagRun
+ | GetXCom
+ | GetXComCount
+ | GetXComSequenceItem
+ | GetXComSequenceSlice
| MaskSecret,
Field(discriminator="type"),
]
@@ -118,7 +130,11 @@ ToDagProcessor = Annotated[
| PreviousDagRunResult
| PrevSuccessfulDagRunResult
| ErrorResponse
- | OKResponse,
+ | OKResponse
+ | XComCountResponse
+ | XComResult
+ | XComSequenceIndexResult
+ | XComSequenceSliceResult,
Field(discriminator="type"),
]
@@ -459,7 +475,11 @@ class DagFileProcessorProcess(WatchedSubprocess):
self.send_msg(msg, request_id=0)
def _handle_request(self, msg: ToManager, log: FilteringBoundLogger, req_id: int) -> None:
- from airflow.sdk.api.datamodels._generated import ConnectionResponse, VariableResponse
+ from airflow.sdk.api.datamodels._generated import (
+ ConnectionResponse,
+ VariableResponse,
+ XComSequenceIndexResponse,
+ )
resp: BaseModel | None = None
dump_opts = {}
@@ -496,6 +516,34 @@ class DagFileProcessorProcess(WatchedSubprocess):
dagrun_result = PrevSuccessfulDagRunResult.from_dagrun_response(dagrun_resp)
resp = dagrun_result
dump_opts = {"exclude_unset": True}
+ elif isinstance(msg, GetXCom):
+ xcom = self.client.xcoms.get(
+ msg.dag_id, msg.run_id, msg.task_id, msg.key, msg.map_index, msg.include_prior_dates
+ )
+ xcom_result = XComResult.from_xcom_response(xcom)
+ resp = xcom_result
+ elif isinstance(msg, GetXComCount):
+ resp = self.client.xcoms.head(msg.dag_id, msg.run_id, msg.task_id, msg.key)
+ elif isinstance(msg, GetXComSequenceItem):
+ xcom = self.client.xcoms.get_sequence_item(
+ msg.dag_id, msg.run_id, msg.task_id, msg.key, msg.offset
+ )
+ if isinstance(xcom, XComSequenceIndexResponse):
+ resp = XComSequenceIndexResult.from_response(xcom)
+ else:
+ resp = xcom
+ elif isinstance(msg, GetXComSequenceSlice):
+ xcoms = self.client.xcoms.get_sequence_slice(
+ msg.dag_id,
+ msg.run_id,
+ msg.task_id,
+ msg.key,
+ msg.start,
+ msg.stop,
+ msg.step,
+ msg.include_prior_dates,
+ )
+ resp = XComSequenceSliceResult.from_response(xcoms)
elif isinstance(msg, MaskSecret):
# Use sdk masker in dag processor and triggerer because those use the task sdk machinery
from airflow.sdk.log import mask_secret
diff --git a/airflow-core/tests/unit/dag_processing/test_processor.py b/airflow-core/tests/unit/dag_processing/test_processor.py
index 14427a6dee5..37d9236face 100644
--- a/airflow-core/tests/unit/dag_processing/test_processor.py
+++ b/airflow-core/tests/unit/dag_processing/test_processor.py
@@ -62,6 +62,12 @@ from airflow.sdk import DAG, BaseOperator
from airflow.sdk.api.client import Client
from airflow.sdk.api.datamodels._generated import DagRunState
from airflow.sdk.execution_time import comms
+from airflow.sdk.execution_time.comms import (
+ GetXCom,
+ GetXComSequenceSlice,
+ XComResult,
+ XComSequenceSliceResult,
+)
from airflow.utils.session import create_session
from airflow.utils.state import TaskInstanceState
@@ -831,6 +837,127 @@ class TestExecuteDagCallbacks:
# Should log warning about no callback found
log.warning.assert_called_once_with("Callback requested, but dag didn't have any", dag_id="test_dag")
+ @pytest.mark.parametrize(
+ "xcom_operation,expected_message_type,expected_message,mock_response",
+ [
+ (
+ lambda ti, task_ids: ti.xcom_pull(key="report_df", task_ids=task_ids),
+ "GetXComSequenceSlice",
+ GetXComSequenceSlice(
+ key="report_df",
+ dag_id="test_dag",
+ run_id="test_run",
+ task_id="test_task",
+ start=None,
+ stop=None,
+ step=None,
+ include_prior_dates=False,
+ ),
+ XComSequenceSliceResult(root=["test data"]),
+ ),
+ (
+ lambda ti, task_ids: ti.xcom_pull(key="single_value", task_ids=["test_task"]),
+ "GetXComSequenceSlice",
+ GetXComSequenceSlice(
+ key="single_value",
+ dag_id="test_dag",
+ run_id="test_run",
+ task_id="test_task",
+ start=None,
+ stop=None,
+ step=None,
+ include_prior_dates=False,
+ ),
+ XComSequenceSliceResult(root=["test data"]),
+ ),
+ (
+ lambda ti, task_ids: ti.xcom_pull(key="direct_value", task_ids="test_task", map_indexes=None),
+ "GetXCom",
+ GetXCom(
+ key="direct_value",
+ dag_id="test_dag",
+ run_id="test_run",
+ task_id="test_task",
+ map_index=None,
+ include_prior_dates=False,
+ ),
+ XComResult(
+ key="direct_value",
+ value="test",
+ ),
+ ),
+ ],
+ )
+ def test_notifier_xcom_operations_send_correct_messages(
+ self,
+ spy_agency,
+ mock_supervisor_comms,
+ xcom_operation,
+ expected_message_type,
+ expected_message,
+ mock_response,
+ ):
+ """Test that different XCom operations send correct message types"""
+
+ mock_supervisor_comms.send.return_value = mock_response
+
+ class TestNotifier:
+ def __call__(self, context):
+ ti = context["ti"]
+ dag = context["dag"]
+ task_ids = list(dag.task_dict)
+ xcom_operation(ti, task_ids)
+
+ with DAG(dag_id="test_dag", on_success_callback=TestNotifier()) as dag:
+ BaseOperator(task_id="test_task")
+
+ def fake_collect_dags(self, *args, **kwargs):
+ self.dags[dag.dag_id] = dag
+
+ spy_agency.spy_on(DagBag.collect_dags, call_fake=fake_collect_dags, owner=DagBag)
+
+ dagbag = DagBag()
+ dagbag.collect_dags()
+
+ current_time = timezone.utcnow()
+ request = DagCallbackRequest(
+ filepath="test.py",
+ dag_id="test_dag",
+ run_id="test_run",
+ bundle_name="testing",
+ bundle_version=None,
+ context_from_server=DagRunContext(
+ dag_run=DRDataModel(
+ dag_id="test_dag",
+ run_id="test_run",
+ logical_date=current_time,
+ data_interval_start=current_time,
+ data_interval_end=current_time,
+ run_after=current_time,
+ start_date=current_time,
+ end_date=None,
+ run_type="manual",
+ state="success",
+ consumed_asset_events=[],
+ ),
+ last_ti=TIDataModel(
+ id=uuid.uuid4(),
+ dag_id="test_dag",
+ task_id="test_task",
+ run_id="test_run",
+ map_index=-1,
+ try_number=1,
+ dag_version_id=uuid.uuid4(),
+ ),
+ ),
+ is_failure_callback=False,
+ msg="Test success message",
+ )
+
+ _execute_dag_callbacks(dagbag, request, structlog.get_logger())
+
+ mock_supervisor_comms.send.assert_called_once_with(msg=expected_message)
+
class TestExecuteTaskCallbacks:
"""Test the _execute_task_callbacks function"""
(airflow) 07/12: Allow slash in Variable keys from TaskSDK read/write(#55324)
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 dd2a83ac56c2f0e3604fdb8ccfd565a5135fff7f
Author: Duc Nguyen <du...@careernowbrands.com>
AuthorDate: Sun Sep 14 00:49:13 2025 +0700
Allow slash in Variable keys from TaskSDK read/write(#55324)
(cherry picked from commit 893f6279e6bb68ed875b2959300f26a58dc98a4a)
---
.../api_fastapi/execution_api/routes/variables.py | 15 ++++-
.../execution_api/versions/head/test_variables.py | 75 +++++++++++++++-------
2 files changed, 65 insertions(+), 25 deletions(-)
diff --git a/airflow-core/src/airflow/api_fastapi/execution_api/routes/variables.py b/airflow-core/src/airflow/api_fastapi/execution_api/routes/variables.py
index e1685987866..d2f5d21349c 100644
--- a/airflow-core/src/airflow/api_fastapi/execution_api/routes/variables.py
+++ b/airflow-core/src/airflow/api_fastapi/execution_api/routes/variables.py
@@ -55,7 +55,7 @@ log = logging.getLogger(__name__)
@router.get(
- "/{variable_key}",
+ "/{variable_key:path}",
responses={
status.HTTP_401_UNAUTHORIZED: {"description": "Unauthorized"},
status.HTTP_403_FORBIDDEN: {"description": "Task does not have access to the variable"},
@@ -63,6 +63,9 @@ log = logging.getLogger(__name__)
)
def get_variable(variable_key: str) -> VariableResponse:
"""Get an Airflow Variable."""
+ if not variable_key:
+ raise HTTPException(status.HTTP_404_NOT_FOUND, detail="Not Found")
+
try:
variable_value = Variable.get(variable_key)
except KeyError:
@@ -78,7 +81,7 @@ def get_variable(variable_key: str) -> VariableResponse:
@router.put(
- "/{variable_key}",
+ "/{variable_key:path}",
status_code=status.HTTP_201_CREATED,
responses={
status.HTTP_401_UNAUTHORIZED: {"description": "Unauthorized"},
@@ -87,12 +90,15 @@ def get_variable(variable_key: str) -> VariableResponse:
)
def put_variable(variable_key: str, body: VariablePostBody):
"""Set an Airflow Variable."""
+ if not variable_key:
+ raise HTTPException(status.HTTP_404_NOT_FOUND, detail="Not Found")
+
Variable.set(key=variable_key, value=body.value, description=body.description)
return {"message": "Variable successfully set"}
@router.delete(
- "/{variable_key}",
+ "/{variable_key:path}",
status_code=status.HTTP_204_NO_CONTENT,
responses={
status.HTTP_401_UNAUTHORIZED: {"description": "Unauthorized"},
@@ -101,4 +107,7 @@ def put_variable(variable_key: str, body: VariablePostBody):
)
def delete_variable(variable_key: str):
"""Delete an Airflow Variable."""
+ if not variable_key:
+ raise HTTPException(status.HTTP_404_NOT_FOUND, detail="Not Found")
+
Variable.delete(key=variable_key)
diff --git a/airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_variables.py b/airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_variables.py
index 0ada165ed5b..0e112ad330a 100644
--- a/airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_variables.py
+++ b/airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_variables.py
@@ -65,17 +65,24 @@ def access_denied(client):
class TestGetVariable:
- def test_variable_get_from_db(self, client, session):
- Variable.set(key="var1", value="value", session=session)
+ @pytest.mark.parametrize(
+ "key, value",
+ [
+ ("var1", "value"),
+ ("var2/with_slash", "slash_value"),
+ ],
+ )
+ def test_variable_get_from_db(self, client, session, key, value):
+ Variable.set(key=key, value=value, session=session)
session.commit()
- response = client.get("/execution/variables/var1")
+ response = client.get(f"/execution/variables/{key}")
assert response.status_code == 200
- assert response.json() == {"key": "var1", "value": "value"}
+ assert response.json() == {"key": key, "value": value}
# Remove connection
- Variable.delete(key="var1", session=session)
+ Variable.delete(key=key, session=session)
session.commit()
@mock.patch.dict(
@@ -88,13 +95,20 @@ class TestGetVariable:
assert response.status_code == 200
assert response.json() == {"key": "key1", "value": "VALUE"}
- def test_variable_get_not_found(self, client):
- response = client.get("/execution/variables/non_existent_var")
+ @pytest.mark.parametrize(
+ "key",
+ [
+ "non_existent_var",
+ "non/existent/slash/var",
+ ],
+ )
+ def test_variable_get_not_found(self, client, key):
+ response = client.get(f"/execution/variables/{key}")
assert response.status_code == 404
assert response.json() == {
"detail": {
- "message": "Variable with key 'non_existent_var' not found",
+ "message": f"Variable with key '{key}' not found",
"reason": "not_found",
}
}
@@ -117,14 +131,18 @@ class TestGetVariable:
class TestPutVariable:
@pytest.mark.parametrize(
- "payload",
+ "key, payload",
[
- pytest.param({"value": "{}", "description": "description"}, id="valid-payload"),
- pytest.param({"value": "{}"}, id="missing-description"),
+ pytest.param("var_create", {"value": "{}", "description": "description"}, id="valid-payload"),
+ pytest.param("var_create", {"value": "{}"}, id="missing-description"),
+ pytest.param(
+ "var_create/with_slash",
+ {"value": "slash_value", "description": "Variable with slash"},
+ id="slash-key",
+ ),
],
)
- def test_should_create_variable(self, client, payload, session):
- key = "var_create"
+ def test_should_create_variable(self, client, key, payload, session):
response = client.put(
f"/execution/variables/{key}",
json=payload,
@@ -132,7 +150,7 @@ class TestPutVariable:
assert response.status_code == 201, response.json()
assert response.json()["message"] == "Variable successfully set"
- var_from_db = session.query(Variable).where(Variable.key == "var_create").first()
+ var_from_db = session.query(Variable).where(Variable.key == key).first()
assert var_from_db is not None
assert var_from_db.key == key
assert var_from_db.val == payload["value"]
@@ -179,8 +197,14 @@ class TestPutVariable:
assert response.json()["detail"][0]["type"] == "extra_forbidden"
assert response.json()["detail"][0]["msg"] == "Extra inputs are not permitted"
- def test_overwriting_existing_variable(self, client, session):
- key = "var_create"
+ @pytest.mark.parametrize(
+ "key",
+ [
+ "var_create",
+ "var_create/with_slash",
+ ],
+ )
+ def test_overwriting_existing_variable(self, client, session, key):
Variable.set(key=key, value="value", session=session)
session.commit()
@@ -218,19 +242,26 @@ class TestPutVariable:
class TestDeleteVariable:
- def test_should_delete_variable(self, client, session):
- for i in range(1, 3):
- Variable.set(key=f"key{i}", value=i)
+ @pytest.mark.parametrize(
+ "keys_to_create, key_to_delete",
+ [
+ (["key1", "key2"], "key1"),
+ (["key3/with_slash", "key4"], "key3/with_slash"),
+ ],
+ )
+ def test_should_delete_variable(self, client, session, keys_to_create, key_to_delete):
+ for i, key in enumerate(keys_to_create, 1):
+ Variable.set(key=key, value=str(i))
vars = session.query(Variable).all()
- assert len(vars) == 2
+ assert len(vars) == len(keys_to_create)
- response = client.delete("/execution/variables/key1")
+ response = client.delete(f"/execution/variables/{key_to_delete}")
assert response.status_code == 204
vars = session.query(Variable).all()
- assert len(vars) == 1
+ assert len(vars) == len(keys_to_create) - 1
def test_should_not_delete_variable(self, client, session):
Variable.set(key="key", value="value")