Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Changes
`Unreleased <https://github.com/Ouranosinc/Magpie/tree/master>`_ (latest)
------------------------------------------------------------------------------------

Features / Changes
~~~~~~~~~~~~~~~~~~~~~

* Update ``sqlalchemy>=2``.
* Security updates to Python and Docker dependencies.

Bug Fixes
~~~~~~~~~

Expand Down
4 changes: 2 additions & 2 deletions magpie/alembic/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ def connect(_connection=None):
if isinstance(_connection, Connection) and not _connection.closed:
return _connection
if not isinstance(_connection, Connectable):
_connection = create_engine(url, convert_unicode=True, echo=False)
_connection = create_engine(url, echo=False)
return _connection.connect()

if not database_exists(url):
db_name = get_constant("MAGPIE_POSTGRES_DB")
LOGGER.warning("Database [%s] not found, attempting creation...", db_name)
create_database(url, encoding="utf8", template="template0")
connection = create_engine(url, convert_unicode=True, echo=False)
connection = create_engine(url, echo=False)

# retry connection and run migration
with connect(connection) as migrate_conn:
Expand Down
2 changes: 0 additions & 2 deletions magpie/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ def get_engine(container=None, prefix="sqlalchemy.", **kwargs):
settings = get_settings(container or {})
settings[prefix + "url"] = get_db_url(settings=settings)
settings.setdefault(prefix + "pool_pre_ping", True)
kwargs = kwargs or {}
kwargs["convert_unicode"] = True
return engine_from_config(settings, prefix, **kwargs)


Expand Down
6 changes: 2 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ requests_file
idna>=3.15.0
simplejson
six>=1.12.0
# see also: safety 51668, https://github.com/sqlalchemy/sqlalchemy/pull/8563
sqlalchemy>=1.4.44,<2 # pyup: ignore
# see also: safety 42194, https://github.com/kvesteri/sqlalchemy-utils/issues/166, not fixed since 2015
sqlalchemy-utils==0.42.1 # pyup: ignore
sqlalchemy>=2.0.52,<3
sqlalchemy-utils==0.42.1
threddsclient>=0.4.7
transaction
typing_extensions
Expand Down
Loading