This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 6dd5793f3d1 Use correct API_VERSION for task sdk integration tests 
(#56715)
6dd5793f3d1 is described below

commit 6dd5793f3d15cbeeb4cc83c1671c1242bd30374b
Author: Amogh Desai <[email protected]>
AuthorDate: Thu Oct 16 16:57:12 2025 +0530

    Use correct API_VERSION for task sdk integration tests (#56715)
---
 task-sdk-tests/tests/task_sdk_tests/conftest.py      |  8 ++++++++
 task-sdk-tests/tests/task_sdk_tests/constants.py     | 20 --------------------
 .../tests/task_sdk_tests/test_task_sdk_health.py     |  7 ++-----
 3 files changed, 10 insertions(+), 25 deletions(-)

diff --git a/task-sdk-tests/tests/task_sdk_tests/conftest.py 
b/task-sdk-tests/tests/task_sdk_tests/conftest.py
index 220b186890f..81f19c1276a 100644
--- a/task-sdk-tests/tests/task_sdk_tests/conftest.py
+++ b/task-sdk-tests/tests/task_sdk_tests/conftest.py
@@ -282,6 +282,14 @@ def airflow_test_setup(docker_compose_setup):
     }
 
 
[email protected](scope="session")
+def task_sdk_api_version():
+    """Get the API version from the installed Task SDK."""
+    from airflow.sdk.api.datamodels._generated import API_VERSION
+
+    return API_VERSION
+
+
 @pytest.fixture(scope="session")
 def auth_token(airflow_test_setup):
     """Get the auth token from setup."""
diff --git a/task-sdk-tests/tests/task_sdk_tests/constants.py 
b/task-sdk-tests/tests/task_sdk_tests/constants.py
index 1e35e0106c2..18ef9538233 100644
--- a/task-sdk-tests/tests/task_sdk_tests/constants.py
+++ b/task-sdk-tests/tests/task_sdk_tests/constants.py
@@ -29,24 +29,4 @@ DOCKER_IMAGE = os.environ.get("DOCKER_IMAGE") or 
DEFAULT_DOCKER_IMAGE
 DOCKER_COMPOSE_HOST_PORT = os.environ.get("HOST_PORT", "localhost:8080")
 TASK_SDK_HOST_PORT = os.environ.get("TASK_SDK_HOST_PORT", "localhost:8080")
 
-
-# This represents the Execution API schema version, NOT the Task SDK package 
version.
-#
-# Purpose:
-# - Defines the API contract between Task SDK and Airflow's Execution API
-# - Enables backward compatibility when API schemas evolve
-# - Uses calver format (YYYY-MM-DD) based on expected release dates
-#
-# Usage:
-# - Sent as "Airflow-API-Version" header with every API request
-# - Server uses this to determine which schema version to serve
-# - Allows older Task SDK versions to work with newer Airflow servers
-#
-# Version vs Package Version:
-# - API Version: "2025-09-23" (schema compatibility)
-# - Package Version: "1.1.0" (Task SDK release version)
-#
-# Keep this in sync with: task-sdk/src/airflow/sdk/api/datamodels/_generated.py
-TASK_SDK_API_VERSION = "2025-09-23"
-
 DOCKER_COMPOSE_FILE_PATH = TASK_SDK_TESTS_ROOT / "docker" / 
"docker-compose.yaml"
diff --git a/task-sdk-tests/tests/task_sdk_tests/test_task_sdk_health.py 
b/task-sdk-tests/tests/task_sdk_tests/test_task_sdk_health.py
index 578068c9c6a..3909ad607dd 100644
--- a/task-sdk-tests/tests/task_sdk_tests/test_task_sdk_health.py
+++ b/task-sdk-tests/tests/task_sdk_tests/test_task_sdk_health.py
@@ -17,17 +17,14 @@
 from __future__ import annotations
 
 from task_sdk_tests import console
-from task_sdk_tests.constants import (
-    TASK_SDK_API_VERSION,
-)
 
 
-def test_task_sdk_health(sdk_client):
+def test_task_sdk_health(sdk_client, task_sdk_api_version):
     """Test Task SDK health check using session setup."""
     client = sdk_client
 
     console.print("[yellow]Making health check request...")
-    response = client.get("health/ping", headers={"Airflow-API-Version": 
TASK_SDK_API_VERSION})
+    response = client.get("health/ping", headers={"Airflow-API-Version": 
task_sdk_api_version})
 
     console.print(" Health Check Response ".center(72, "="))
     console.print(f"[bright_blue]Status Code:[/] {response.status_code}")

Reply via email to