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/04/25 17:28:52 UTC
(airflow) branch v3-0-test updated (fe5d8911911 -> 7bdfa197e72)
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a change to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
from fe5d8911911 [v3-0-test] Add redirects for old operators location to standard provider (#49776) (#49780)
new 3eeb2533a42 Fix execution API server URL handling for relative paths (#49782)
new 396783a54b6 Display bundle version in Dag details tab (#49787)
new 3e3e7e85e01 Add using the rest api by referring to security/api.rst (#49675)
new f5318a734af Add correct redirects for rest api and upgrade docs (#49764)
new 7bdfa197e72 Add bundle_version to DagRun response (#49726)
The 5 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:
airflow-core/docs/howto/index.rst | 1 +
airflow-core/docs/redirects.txt | 3 +--
.../src/airflow/api_fastapi/core_api/datamodels/dag_run.py | 1 +
.../airflow/api_fastapi/core_api/openapi/_private_ui.yaml | 6 ++++++
.../api_fastapi/core_api/openapi/v1-rest-api-generated.yaml | 6 ++++++
airflow-core/src/airflow/config_templates/config.yml | 3 ++-
airflow-core/src/airflow/executors/local_executor.py | 3 +++
.../src/airflow/ui/openapi-gen/requests/schemas.gen.ts | 12 ++++++++++++
.../src/airflow/ui/openapi-gen/requests/types.gen.ts | 1 +
airflow-core/src/airflow/ui/src/pages/Dag/Details.tsx | 6 ++++++
.../unit/api_fastapi/core_api/routes/public/test_assets.py | 1 +
.../unit/api_fastapi/core_api/routes/public/test_dag_run.py | 4 ++++
airflow-core/tests/unit/cli/commands/test_asset_command.py | 1 +
airflow-core/tests/unit/executors/test_local_executor.py | 11 ++++++++++-
airflow-ctl/src/airflowctl/api/datamodels/generated.py | 1 +
.../providers/celery/executors/celery_executor_utils.py | 3 +++
.../edge3/src/airflow/providers/edge3/cli/edge_command.py | 3 +++
17 files changed, 62 insertions(+), 4 deletions(-)
(airflow) 04/05: Add correct redirects for rest api and upgrade docs (#49764)
Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit f5318a734affc4a136f27335e4e2ab5059877049
Author: Amogh Desai <am...@gmail.com>
AuthorDate: Fri Apr 25 17:31:44 2025 +0530
Add correct redirects for rest api and upgrade docs (#49764)
* Add correct redirects for rest api and upgrade docs
* Update redirects.txt
(cherry picked from commit bd721d728169dd92f2ea177c172e462334e86dba)
---
airflow-core/docs/redirects.txt | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/airflow-core/docs/redirects.txt b/airflow-core/docs/redirects.txt
index 27bfc1f95fa..aadf5e09f1a 100644
--- a/airflow-core/docs/redirects.txt
+++ b/airflow-core/docs/redirects.txt
@@ -75,7 +75,7 @@ start/index.rst start.rst
# References
cli-ref.rst cli-and-env-variables-ref.rst
_api/index.rst public-airflow-interface.rst
-rest-api-ref.rst deprecated-rest-api-ref.rst
+deprecated-rest-api-ref.rst rest-api-ref.rst
macros-ref.rst templates-ref.rst
# Concepts
@@ -85,7 +85,6 @@ scheduler.rst administration-and-deployment/scheduler.rst
# Installation
installation.rst installation/index.rst
upgrade-check.rst installation/upgrade-check.rst
-upgrading-to-2.rst howto/upgrading-from-1-10/index.rst
# Release Notes
changelog.rst release_notes.rst
(airflow) 05/05: Add bundle_version to DagRun response (#49726)
Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 7bdfa197e72e3473399757d7723c2c0607b284df
Author: Daniel Standish <15...@users.noreply.github.com>
AuthorDate: Thu Apr 24 20:51:15 2025 -0700
Add bundle_version to DagRun response (#49726)
The field was missing.
Note on relationship to #49007...
In #49007 the concern was raised about the DagVersion record not pointing to the current bundle version when the bundle version changed but dag structure did not.
The user assumed that this meant the dag run was associated with the wrong bundle version. Adding the dag run bundle version will let the user see that that the associaton is correct.
Users may now see two "bundle versions" in the dag run response. But the reason for this can be understood. If the DagVersion record points to an older bundle version, it is because the dag structure did not change when the code changed. But since the scheduler just cares about dag structure, it doesn't matter, and it still tells the truth -- the version of the dag version is the bundle version which caused that revision.
closes https://github.com/apache/airflow/issues/49007
(cherry picked from commit b70ece0ae8531cf8c692335a1eb02cba11159ab4)
---
.../src/airflow/api_fastapi/core_api/datamodels/dag_run.py | 1 +
.../airflow/api_fastapi/core_api/openapi/_private_ui.yaml | 6 ++++++
.../api_fastapi/core_api/openapi/v1-rest-api-generated.yaml | 6 ++++++
.../src/airflow/ui/openapi-gen/requests/schemas.gen.ts | 12 ++++++++++++
.../src/airflow/ui/openapi-gen/requests/types.gen.ts | 1 +
.../unit/api_fastapi/core_api/routes/public/test_assets.py | 1 +
.../unit/api_fastapi/core_api/routes/public/test_dag_run.py | 4 ++++
airflow-core/tests/unit/cli/commands/test_asset_command.py | 1 +
airflow-ctl/src/airflowctl/api/datamodels/generated.py | 1 +
9 files changed, 33 insertions(+)
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_run.py b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_run.py
index a6bcf3361ad..49661dfd5db 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_run.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/datamodels/dag_run.py
@@ -76,6 +76,7 @@ class DAGRunResponse(BaseModel):
conf: dict
note: str | None
dag_versions: list[DagVersionResponse]
+ bundle_version: str | None
class DAGRunCollectionResponse(BaseModel):
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 fea53243761..f3237ddbe1f 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
@@ -931,6 +931,11 @@ components:
$ref: '#/components/schemas/DagVersionResponse'
type: array
title: Dag Versions
+ bundle_version:
+ anyOf:
+ - type: string
+ - type: 'null'
+ title: Bundle Version
type: object
required:
- dag_run_id
@@ -949,6 +954,7 @@ components:
- conf
- note
- dag_versions
+ - bundle_version
title: DAGRunResponse
description: DAG Run serializer for responses.
DAGRunStates:
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-rest-api-generated.yaml b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-rest-api-generated.yaml
index b1ce96d4bba..0f8b0f2496d 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-rest-api-generated.yaml
+++ b/airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-rest-api-generated.yaml
@@ -8231,6 +8231,11 @@ components:
$ref: '#/components/schemas/DagVersionResponse'
type: array
title: Dag Versions
+ bundle_version:
+ anyOf:
+ - type: string
+ - type: 'null'
+ title: Bundle Version
type: object
required:
- dag_run_id
@@ -8249,6 +8254,7 @@ components:
- conf
- note
- dag_versions
+ - bundle_version
title: DAGRunResponse
description: DAG Run serializer for responses.
DAGRunsBatchBody:
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 112e0878c1c..481a5142df7 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
@@ -2255,6 +2255,17 @@ export const $DAGRunResponse = {
type: "array",
title: "Dag Versions",
},
+ bundle_version: {
+ anyOf: [
+ {
+ type: "string",
+ },
+ {
+ type: "null",
+ },
+ ],
+ title: "Bundle Version",
+ },
},
type: "object",
required: [
@@ -2274,6 +2285,7 @@ export const $DAGRunResponse = {
"conf",
"note",
"dag_versions",
+ "bundle_version",
],
title: "DAGRunResponse",
description: "DAG Run serializer for responses.",
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 ae3b22b9d33..8b626f7ffed 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
@@ -577,6 +577,7 @@ export type DAGRunResponse = {
};
note: string | null;
dag_versions: Array<DagVersionResponse>;
+ bundle_version: string | null;
};
/**
diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py
index 52c5108f2cd..6a3f889cfe2 100644
--- a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py
+++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py
@@ -1144,6 +1144,7 @@ class TestPostAssetMaterialize(TestAssets):
response = test_client.post("/assets/1/materialize")
assert response.status_code == 200
assert response.json() == {
+ "bundle_version": None,
"dag_run_id": mock.ANY,
"dag_id": self.DAG_ASSET1_ID,
"dag_versions": mock.ANY,
diff --git a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_run.py b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_run.py
index 7605220da29..2d60fedbd19 100644
--- a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_run.py
+++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_run.py
@@ -167,6 +167,7 @@ def get_dag_versions_dict(dag_versions: list[DagVersion]) -> list[dict]:
def get_dag_run_dict(run: DagRun):
return {
+ "bundle_version": None,
"dag_run_id": run.run_id,
"dag_id": run.dag_id,
"logical_date": from_datetime_to_zulu_without_ms(run.logical_date),
@@ -1303,6 +1304,7 @@ class TestTriggerDagRun:
session.query(DagRun).where(DagRun.dag_id == DAG1_ID, DagRun.run_id == expected_dag_run_id).one()
)
expected_response_json = {
+ "bundle_version": None,
"conf": {},
"dag_id": DAG1_ID,
"dag_run_id": expected_dag_run_id,
@@ -1492,6 +1494,7 @@ class TestTriggerDagRun:
assert response_1.status_code == 200
assert response_1.json() == {
+ "bundle_version": None,
"dag_run_id": RUN_ID_1,
"dag_id": DAG1_ID,
"dag_versions": mock.ANY,
@@ -1576,6 +1579,7 @@ class TestTriggerDagRun:
)
assert response.status_code == 200
assert response.json() == {
+ "bundle_version": None,
"dag_run_id": mock.ANY,
"dag_id": DAG1_ID,
"dag_versions": mock.ANY,
diff --git a/airflow-core/tests/unit/cli/commands/test_asset_command.py b/airflow-core/tests/unit/cli/commands/test_asset_command.py
index 64ae74ed8ff..738dceadbf6 100644
--- a/airflow-core/tests/unit/cli/commands/test_asset_command.py
+++ b/airflow-core/tests/unit/cli/commands/test_asset_command.py
@@ -141,6 +141,7 @@ def test_cli_assets_materialize(parser: ArgumentParser) -> None:
assert run_list[0] | undeterministic == undeterministic | {
"conf": {},
+ "bundle_version": None,
"dag_id": "asset1_producer",
"end_date": None,
"last_scheduling_decision": None,
diff --git a/airflow-ctl/src/airflowctl/api/datamodels/generated.py b/airflow-ctl/src/airflowctl/api/datamodels/generated.py
index a46626755ba..405970db66d 100644
--- a/airflow-ctl/src/airflowctl/api/datamodels/generated.py
+++ b/airflow-ctl/src/airflowctl/api/datamodels/generated.py
@@ -1217,6 +1217,7 @@ class DAGRunResponse(BaseModel):
conf: Annotated[dict[str, Any], Field(title="Conf")]
note: Annotated[str | None, Field(title="Note")] = None
dag_versions: Annotated[list[DagVersionResponse], Field(title="Dag Versions")]
+ bundle_version: Annotated[str | None, Field(title="Bundle Version")] = None
class DAGRunsBatchBody(BaseModel):
(airflow) 03/05: Add using the rest api by referring to security/api.rst (#49675)
Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 3e3e7e85e01919dbc2835bc4488500cfa79b2c12
Author: Kalyan R <ka...@live.com>
AuthorDate: Fri Apr 25 19:31:31 2025 +0530
Add using the rest api by referring to security/api.rst (#49675)
(cherry picked from commit 7077bdf570406db31bdba0bec4e730857bf34d8e)
---
airflow-core/docs/howto/index.rst | 1 +
1 file changed, 1 insertion(+)
diff --git a/airflow-core/docs/howto/index.rst b/airflow-core/docs/howto/index.rst
index aa8372dd919..a4bd7912008 100644
--- a/airflow-core/docs/howto/index.rst
+++ b/airflow-core/docs/howto/index.rst
@@ -30,6 +30,7 @@ configuring an Airflow environment.
:maxdepth: 2
Using the CLI <usage-cli>
+ Using the REST API <../security/api>
add-dag-tags
notifications
set-config
(airflow) 01/05: Fix execution API server URL handling for relative paths (#49782)
Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 3eeb2533a425dd25ffeebd5e71306f048a12f38c
Author: Kaxil Naik <ka...@apache.org>
AuthorDate: Fri Apr 25 22:55:15 2025 +0530
Fix execution API server URL handling for relative paths (#49782)
Follow-up of https://github.com/apache/airflow/pull/49747 which broke some workflows including `breeze start-airflow`, requiring https://github.com/apache/airflow/pull/49753.
When base_url is a relative path (starts with '/'), default to using
http://localhost:8080 as the base URL. This maintains backward compatibility
with the previous default behavior while still allowing custom absolute URLs
through either `base_url` or `execution_api_server_url` configuration.
Fixes `httpx.UnsupportedProtocol` error (as seen in https://github.com/apache/airflow/pull/49753) that occurred when base_url was
a relative path without protocol.
(cherry picked from commit 3b9ae489a56cde7fe1cd663d7da88fabb831c664)
---
airflow-core/src/airflow/config_templates/config.yml | 3 ++-
airflow-core/src/airflow/executors/local_executor.py | 3 +++
airflow-core/tests/unit/executors/test_local_executor.py | 11 ++++++++++-
.../providers/celery/executors/celery_executor_utils.py | 3 +++
.../edge3/src/airflow/providers/edge3/cli/edge_command.py | 3 +++
5 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/airflow-core/src/airflow/config_templates/config.yml b/airflow-core/src/airflow/config_templates/config.yml
index f63e39180e7..f6824e3da38 100644
--- a/airflow-core/src/airflow/config_templates/config.yml
+++ b/airflow-core/src/airflow/config_templates/config.yml
@@ -537,7 +537,8 @@ core:
execution_api_server_url:
description: |
The url of the execution api server. Default is ``{BASE_URL}/execution/``
- where ``{BASE_URL}`` is the base url of the API Server.
+ where ``{BASE_URL}`` is the base url of the API Server. If ``{BASE_URL}`` is not set,
+ it will use ``http://localhost:8080`` as the default base url.
version_added: 3.0.0
type: string
example: ~
diff --git a/airflow-core/src/airflow/executors/local_executor.py b/airflow-core/src/airflow/executors/local_executor.py
index 867c1bc254e..4c8ca1e73cb 100644
--- a/airflow-core/src/airflow/executors/local_executor.py
+++ b/airflow-core/src/airflow/executors/local_executor.py
@@ -110,6 +110,9 @@ def _execute_work(log: logging.Logger, workload: workloads.ExecuteTask) -> None:
setproctitle(f"airflow worker -- LocalExecutor: {workload.ti.id}")
base_url = conf.get("api", "base_url", fallback="/")
+ # If it's a relative URL, use localhost:8080 as the default
+ if base_url.startswith("/"):
+ base_url = f"http://localhost:8080{base_url}"
default_execution_api_server = f"{base_url.rstrip('/')}/execution/"
# This will return the exit code of the task process, but we don't care about that, just if the
diff --git a/airflow-core/tests/unit/executors/test_local_executor.py b/airflow-core/tests/unit/executors/test_local_executor.py
index c693d5a6f76..eb4b9528d1c 100644
--- a/airflow-core/tests/unit/executors/test_local_executor.py
+++ b/airflow-core/tests/unit/executors/test_local_executor.py
@@ -185,8 +185,17 @@ class TestLocalExecutor:
},
"http://custom-server/execution/",
),
+ ({}, "http://localhost:8080/execution/"),
+ ({("api", "base_url"): "/"}, "http://localhost:8080/execution/"),
+ ({("api", "base_url"): "/airflow/"}, "http://localhost:8080/airflow/execution/"),
+ ],
+ ids=[
+ "base_url_fallback",
+ "custom_server",
+ "no_base_url_no_custom",
+ "base_url_no_custom",
+ "relative_base_url",
],
- ids=["base_url_fallback", "custom_server"],
)
@mock.patch("airflow.sdk.execution_time.supervisor.supervise")
def test_execution_api_server_url_config(self, mock_supervise, conf_values, expected_server):
diff --git a/providers/celery/src/airflow/providers/celery/executors/celery_executor_utils.py b/providers/celery/src/airflow/providers/celery/executors/celery_executor_utils.py
index 7956e6d90e7..002c20145d9 100644
--- a/providers/celery/src/airflow/providers/celery/executors/celery_executor_utils.py
+++ b/providers/celery/src/airflow/providers/celery/executors/celery_executor_utils.py
@@ -159,6 +159,9 @@ def execute_workload(input: str) -> None:
log.info("[%s] Executing workload in Celery: %s", celery_task_id, workload)
base_url = conf.get("api", "base_url", fallback="/")
+ # If it's a relative URL, use localhost:8080 as the default
+ if base_url.startswith("/"):
+ base_url = f"http://localhost:8080{base_url}"
default_execution_api_server = f"{base_url.rstrip('/')}/execution/"
supervise(
diff --git a/providers/edge3/src/airflow/providers/edge3/cli/edge_command.py b/providers/edge3/src/airflow/providers/edge3/cli/edge_command.py
index 19dba52deea..40f8a430132 100644
--- a/providers/edge3/src/airflow/providers/edge3/cli/edge_command.py
+++ b/providers/edge3/src/airflow/providers/edge3/cli/edge_command.py
@@ -272,6 +272,9 @@ class _EdgeWorkerCli:
try:
base_url = conf.get("api", "base_url", fallback="/")
+ # If it's a relative URL, use localhost:8080 as the default
+ if base_url.startswith("/"):
+ base_url = f"http://localhost:8080{base_url}"
default_execution_api_server = f"{base_url.rstrip('/')}/execution/"
supervise(
(airflow) 02/05: Display bundle version in Dag details tab (#49787)
Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kaxilnaik pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 396783a54b68abaca60f94d078044fc7ee8ad161
Author: Pierre Jeambrun <pi...@gmail.com>
AuthorDate: Fri Apr 25 16:41:55 2025 +0200
Display bundle version in Dag details tab (#49787)
(cherry picked from commit ea5197e9cd0a1f99f22e6fde1451bf3f1aabf83b)
---
airflow-core/src/airflow/ui/src/pages/Dag/Details.tsx | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/airflow-core/src/airflow/ui/src/pages/Dag/Details.tsx b/airflow-core/src/airflow/ui/src/pages/Dag/Details.tsx
index e164e602c28..bc290c9f1dd 100644
--- a/airflow-core/src/airflow/ui/src/pages/Dag/Details.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Dag/Details.tsx
@@ -70,6 +70,12 @@ export const Details = () => {
<Time datetime={dag.last_parsed} />
</Table.Cell>
</Table.Row>
+ {dag.bundle_version !== null && (
+ <Table.Row>
+ <Table.Cell>Bundle Version</Table.Cell>
+ <Table.Cell>{dag.bundle_version}</Table.Cell>
+ </Table.Row>
+ )}
<Table.Row>
<Table.Cell>Latest Dag Version</Table.Cell>
<Table.Cell>