Skip to content
Draft
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
2 changes: 1 addition & 1 deletion airflow-core/src/airflow/config_templates/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ database:
Check connection at the start of each connection pool checkout.
Typically, this is a simple statement like "SELECT 1".
See `SQLAlchemy Pooling: Disconnect Handling - Pessimistic
<https://docs.sqlalchemy.org/en/14/core/pooling.html#disconnect-handling-pessimistic>`__
<https://docs.sqlalchemy.org/en/20/core/pooling.html#disconnect-handling-pessimistic>`__
for more details.
version_added: 2.3.0
type: boolean
Expand Down
6 changes: 4 additions & 2 deletions airflow-core/src/airflow/utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@
from airflow.models.connection import Connection
from airflow.typing_compat import Self

# TODO: Import this from sqlalchemy.orm instead when switching to SQLA 2.
# https://docs.sqlalchemy.org/en/20/orm/mapping_api.html#sqlalchemy.orm.MappedClassProtocol
# Note: SQLAlchemy 2.x (already required by this package) ships its own
# sqlalchemy.orm.MappedClassProtocol, but it checks for __table__/__mapper__/__call__
# rather than __tablename__, so it isn't a drop-in replacement for this local protocol.
# See https://docs.sqlalchemy.org/en/20/orm/mapping_api.html#sqlalchemy.orm.MappedClassProtocol
class MappedClassProtocol(Protocol):
"""Protocol for SQLALchemy model base."""

Expand Down
2 changes: 1 addition & 1 deletion airflow-core/tests/unit/utils/test_orm_event_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

"""
These tests ensure compatibility with the deprecation of `sqlalchemy.orm.mapper()` in SQLAlchemy 2.0.0.b1.
See also: https://docs.sqlalchemy.org/en/21/orm/mapping_styles.html#orm-imperative-mapping
See also: https://docs.sqlalchemy.org/en/20/orm/mapping_styles.html#orm-imperative-mapping
"""

from __future__ import annotations
Expand Down
Loading