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

shahar1 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 5f337adeb19 Remove unused API and SDK test helpers (#75884)
5f337adeb19 is described below

commit 5f337adeb19b1836f7934bdc9465cfd5755b11e7
Author: Hussein Awala <[email protected]>
AuthorDate: Thu Oct 29 06:19:04 2026 +0100

    Remove unused API and SDK test helpers (#75884)
---
 airflow-core/tests/unit/api_fastapi/common/test_exceptions.py | 11 -----------
 .../unit/api_fastapi/core_api/routes/public/test_assets.py    | 10 ----------
 .../unit/api_fastapi/core_api/routes/public/test_variables.py |  6 ------
 task-sdk/tests/task_sdk/definitions/test_asset_decorators.py  |  7 -------
 4 files changed, 34 deletions(-)

diff --git a/airflow-core/tests/unit/api_fastapi/common/test_exceptions.py 
b/airflow-core/tests/unit/api_fastapi/common/test_exceptions.py
index def8a0abd30..8e5f01c12b1 100644
--- a/airflow-core/tests/unit/api_fastapi/common/test_exceptions.py
+++ b/airflow-core/tests/unit/api_fastapi/common/test_exceptions.py
@@ -96,17 +96,6 @@ def generate_test_cases_parametrize(
     return generated_test_cases
 
 
-def get_unique_constraint_error_prefix():
-    """Get unique constraint error prefix based on current database dialect."""
-    if CURRENT_DATABASE_DIALECT.startswith(_DatabaseDialect.SQLITE.value):
-        return 
_UniqueConstraintErrorHandler.unique_constraint_error_prefix_dict[_DatabaseDialect.SQLITE]
-    if CURRENT_DATABASE_DIALECT.startswith(_DatabaseDialect.MYSQL.value):
-        return 
_UniqueConstraintErrorHandler.unique_constraint_error_prefix_dict[_DatabaseDialect.MYSQL]
-    if CURRENT_DATABASE_DIALECT.startswith(_DatabaseDialect.POSTGRES.value):
-        return 
_UniqueConstraintErrorHandler.unique_constraint_error_prefix_dict[_DatabaseDialect.POSTGRES]
-    return ""
-
-
 class TestUniqueConstraintErrorHandler:
     unique_constraint_error_handler = _UniqueConstraintErrorHandler()
 
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 6ab18c19990..ea87274ecd0 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
@@ -298,12 +298,6 @@ def _create_assets_events_with_sensitive_extra(session, 
num: int = 2) -> None:
     session.commit()
 
 
-def _create_provided_asset_event(session, asset_event: AssetEvent) -> None:
-    _ensure_source_dag(session)
-    session.add(asset_event)
-    session.commit()
-
-
 def _create_dag_run(session, num: int = 2):
     _ensure_source_dag(session)
     dag_runs = [
@@ -383,10 +377,6 @@ class TestAssets:
     def create_assets_events_with_sensitive_extra(self, num: int = 2, *, 
session):
         _create_assets_events_with_sensitive_extra(session=session, num=num)
 
-    @provide_session
-    def create_provided_asset_event(self, asset_event: AssetEvent, *, session):
-        _create_provided_asset_event(session=session, asset_event=asset_event)
-
     @provide_session
     def create_dag_run(self, num: int = 2, *, session):
         _create_dag_run(num=num, session=session)
diff --git 
a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_variables.py 
b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_variables.py
index 29c1f4a87d5..d20ed0d0a54 100644
--- 
a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_variables.py
+++ 
b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_variables.py
@@ -17,7 +17,6 @@
 from __future__ import annotations
 
 import json
-from io import BytesIO
 from unittest import mock
 from unittest.mock import ANY
 
@@ -71,11 +70,6 @@ TEST_VARIABLE_SEARCH_VALUE = "random search value"
 TEST_VARIABLE_SEARCH_DESCRIPTION = "Some description for the variable"
 
 
-# Helper function to simulate file upload
-def create_file_upload(content: dict) -> BytesIO:
-    return BytesIO(json.dumps(content).encode("utf-8"))
-
-
 @provide_session
 def _create_variables(*, session: Session = NEW_SESSION) -> None:
     team = session.scalars(select(Team).where(Team.name == "test")).one()
diff --git a/task-sdk/tests/task_sdk/definitions/test_asset_decorators.py 
b/task-sdk/tests/task_sdk/definitions/test_asset_decorators.py
index 50ec767b28c..a5934b2d1c7 100644
--- a/task-sdk/tests/task_sdk/definitions/test_asset_decorators.py
+++ b/task-sdk/tests/task_sdk/definitions/test_asset_decorators.py
@@ -49,13 +49,6 @@ def example_asset_func(func_fixer):
     return _example_asset_func
 
 
[email protected]
-def example_asset_definition(example_asset_func):
-    return asset(schedule=None, uri="s3://bucket/object", group="MLModel", 
extra={"k": "v"})(
-        example_asset_func
-    )
-
-
 @pytest.fixture
 def example_asset_func_with_valid_arg_as_inlet_asset(func_fixer):
     @func_fixer

Reply via email to