SQLAlchemy 2.0: Drop use of removed autoload

The autoload arugment was removed[1] in SQLAlchemy and only
the autoload_with argument should be passed.

The autoload argument is set according to the autoload_with argument
automatically even in SQLAlchemy 1.x[2] so is not at all needed.

[1] c932123bac
[2] ad8f921e96

Closes-Bug: #2061303
Change-Id: Ic18044b8065d2350c180ad26f5307a77aa99037b
This commit is contained in:
Takashi Kajinami 2024-04-15 02:14:32 +09:00
parent fa7cc01787
commit d0c29009e6
2 changed files with 2 additions and 2 deletions

View File

@ -30,5 +30,5 @@ down_revision = '543f5d8e4e56'
def upgrade():
bind = op.get_bind()
md = sa.MetaData()
sa.Table('operating_status', md, autoload=True, autoload_with=bind)
sa.Table('operating_status', md, autoload_with=bind)
op.bulk_insert(md.tables['operating_status'], [{'name': 'NO_MONITOR'}])

View File

@ -30,5 +30,5 @@ down_revision = 'e6672bda93bf'
def upgrade():
bind = op.get_bind()
md = sa.MetaData()
sa.Table('operating_status', md, autoload=True, autoload_with=bind)
sa.Table('operating_status', md, autoload_with=bind)
op.bulk_insert(md.tables['operating_status'], [{'name': 'DRAINING'}])