Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions airflow-core/src/airflow/models/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from airflow.exceptions import AirflowException, PoolNotFound
from airflow.models.base import Base
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 mapped_column, with_row_locks
from airflow.utils.state import TaskInstanceState
Expand Down Expand Up @@ -129,22 +128,6 @@ def get_default_pool(session: Session = NEW_SESSION) -> Pool | None:
"""
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(
Expand Down
8 changes: 0 additions & 8 deletions airflow-core/tests/unit/models/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,6 @@ def test_delete_default_pool_not_allowed(self):
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_name=testing_team.name)
session.add(pool)
Expand Down