Skip to content

Commit

Permalink
Add back accidentally removed create_session in utils/db.py (#31705)
Browse files Browse the repository at this point in the history
The create_session function was accidentally removed in commit
522661b
and it's a breaking change.
  • Loading branch information
ephraimbuddy authored Jun 4, 2023
1 parent f69dd29 commit 5f3a464
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from airflow.utils import helpers

# TODO: remove create_session once we decide to break backward compatibility
from airflow.utils.session import NEW_SESSION, provide_session
from airflow.utils.session import NEW_SESSION, create_session, provide_session # noqa: F401

if TYPE_CHECKING:
from alembic.runtime.environment import EnvironmentContext
Expand Down
3 changes: 3 additions & 0 deletions tests/utils/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
compare_server_default,
compare_type,
create_default_connections,
# The create_session is not used. It is imported here to
# guard against removing it from utils.db accidentally
create_session, # noqa: F401
downgrade,
resetdb,
upgradedb,
Expand Down

0 comments on commit 5f3a464

Please sign in to comment.