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

Change-Id: I000e5e78f97f82ed4ea64d42f1c38354c3252e08
This commit is contained in:
Takashi Kajinami 2024-05-08 15:24:52 +09:00
parent bc5922c684
commit 198ea6da3d
1 changed files with 1 additions and 2 deletions

View File

@ -58,8 +58,7 @@ class WatcherJobStore(sqlalchemy.SQLAlchemyJobStore):
super(WatcherJobStore, self).__init__(url, engine, tablename,
metadata, pickle_protocol)
metadata = maybe_ref(metadata) or MetaData()
self.jobs_t = Table(tablename, metadata, autoload=True,
autoload_with=engine)
self.jobs_t = Table(tablename, metadata, autoload_with=engine)
service_ident = service.ServiceHeartbeat.get_service_name()
self.tag = tag or {'host': service_ident[0], 'name': service_ident[1]}
self.service_id = objects.Service.list(context=context.make_context(),