This is an automated email from the ASF dual-hosted git repository.
vincbeck pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new 7a42423a42a [v3-1-test] Remove unused method `is_default_pool` in Pool
model (#61084) (#61128)
7a42423a42a is described below
commit 7a42423a42ab70de883a65c151bcef8a4f62a352
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Jan 27 11:35:26 2026 -0500
[v3-1-test] Remove unused method `is_default_pool` in Pool model (#61084)
(#61128)
(cherry picked from commit dfa93563cf668077072c59ad26d37439be4f5557)
Co-authored-by: Vincent <[email protected]>
---
airflow-core/src/airflow/models/pool.py | 17 -----------------
airflow-core/tests/unit/models/test_pool.py | 8 --------
2 files changed, 25 deletions(-)
diff --git a/airflow-core/src/airflow/models/pool.py
b/airflow-core/src/airflow/models/pool.py
index 7a205036530..fdcfe516e5e 100644
--- a/airflow-core/src/airflow/models/pool.py
+++ b/airflow-core/src/airflow/models/pool.py
@@ -26,7 +26,6 @@ from airflow.exceptions import AirflowException, PoolNotFound
from airflow.models.base import Base
from airflow.models.team import Team
from airflow.ti_deps.dependencies_states import EXECUTION_STATES
-from airflow.utils.db import exists_query
from airflow.utils.session import NEW_SESSION, provide_session
from airflow.utils.sqlalchemy import with_row_locks
from airflow.utils.state import TaskInstanceState
@@ -93,22 +92,6 @@ class Pool(Base):
"""
return Pool.get_pool(Pool.DEFAULT_POOL_NAME, session=session)
- @staticmethod
- @provide_session
- def is_default_pool(id: int, session: Session = NEW_SESSION) -> bool:
- """
- Check id if is the default_pool.
-
- :param id: pool id
- :param session: SQLAlchemy ORM Session
- :return: True if id is default_pool, otherwise False
- """
- return exists_query(
- Pool.id == id,
- Pool.pool == Pool.DEFAULT_POOL_NAME,
- session=session,
- )
-
@staticmethod
@provide_session
def create_or_update_pool(
diff --git a/airflow-core/tests/unit/models/test_pool.py
b/airflow-core/tests/unit/models/test_pool.py
index 5f53474ae24..ec1ffd21a46 100644
--- a/airflow-core/tests/unit/models/test_pool.py
+++ b/airflow-core/tests/unit/models/test_pool.py
@@ -318,14 +318,6 @@ class TestPool:
with pytest.raises(AirflowException, match="^default_pool cannot be
deleted$"):
Pool.delete_pool(Pool.DEFAULT_POOL_NAME)
- def test_is_default_pool(self):
- pool = Pool.create_or_update_pool(
- name="not_default_pool", slots=1, description="test",
include_deferred=False
- )
- default_pool = Pool.get_default_pool()
- assert not Pool.is_default_pool(id=pool.id)
- assert Pool.is_default_pool(str(default_pool.id))
-
def test_get_team_name(self, testing_team: Team, session: Session):
pool = Pool(pool="test", include_deferred=False,
team_id=testing_team.id)
session.add(pool)