mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Do not use legacy string interpolation on URL obj
This fixes the pgcleanup script and an integration test. The test fails because of an error in the script. The error is caused by incorrect string formatting. The new SQLAlchemy URL object extends collections.namedtuple, and a tuple is incompatible with printf-style formating. Ref: https://github.com/sqlalchemy/sqlalchemy/blob/18dbd6aa12a7eca0acb1e2c4f752088e24d6adae/lib/sqlalchemy/engine/url.py#L36 https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting
This commit is contained in:
@@ -991,7 +991,7 @@ class Cleanup:
|
||||
def conn(self):
|
||||
if self.__conn is None:
|
||||
url = make_url(galaxy.config.get_database_url(self.config))
|
||||
log.info('Connecting to database with URL: %s' % url)
|
||||
log.info(f'Connecting to database with URL: {url}')
|
||||
args = url.translate_connect_args(username='user')
|
||||
args.update(url.query)
|
||||
assert url.get_dialect().name == 'postgresql', 'This script can only be used with PostgreSQL.'
|
||||
|
||||
Reference in New Issue
Block a user