File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1643,7 +1643,7 @@ def resetdb(session: Session = NEW_SESSION, skip_init: bool = False):
1643
1643
with create_global_lock (session = session , lock = DBLocks .MIGRATIONS ):
1644
1644
with connection .begin ():
1645
1645
drop_airflow_models (connection )
1646
- drop_airflow_moved_tables (session )
1646
+ drop_airflow_moved_tables (connection )
1647
1647
1648
1648
if not skip_init :
1649
1649
initdb (session = session )
@@ -1725,11 +1725,11 @@ def drop_airflow_models(connection):
1725
1725
version .drop (connection )
1726
1726
1727
1727
1728
- def drop_airflow_moved_tables (session ):
1728
+ def drop_airflow_moved_tables (connection ):
1729
1729
from airflow .models .base import Base
1730
1730
from airflow .settings import AIRFLOW_MOVED_TABLE_PREFIX
1731
1731
1732
- tables = set (inspect (session . get_bind () ).get_table_names ())
1732
+ tables = set (inspect (connection ).get_table_names ())
1733
1733
to_delete = [Table (x , Base .metadata ) for x in tables if x .startswith (AIRFLOW_MOVED_TABLE_PREFIX )]
1734
1734
for tbl in to_delete :
1735
1735
tbl .drop (settings .engine , checkfirst = False )
Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ def test_resetdb(
230
230
session_mock = MagicMock ()
231
231
resetdb (session_mock , skip_init = skip_init )
232
232
mock_drop_airflow .assert_called_once_with (mock_connect .return_value )
233
- mock_drop_moved .assert_called_once_with (session_mock )
233
+ mock_drop_moved .assert_called_once_with (mock_connect . return_value )
234
234
if skip_init :
235
235
mock_init .assert_not_called ()
236
236
else :
You can’t perform that action at this time.
0 commit comments