File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed
packages/postgres-database/src/simcore_postgres_database
services/web/server/src/simcore_service_webserver/db Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change 2121 SEE https://www.postgresql.org/docs/current/errcodes-appendix.html
2222"""
2323
24+ import warnings
25+
2426# NOTE: psycopg2.errors are created dynamically
2527# pylint: disable=no-name-in-module
2628from psycopg2 import (
4648
4749assert issubclass (UniqueViolation , IntegrityError ) # nosec
4850
51+
52+ warnings .warn (
53+ (
54+ "DEPRECATED: The aiopg DBAPI exceptions in this module are no longer used. "
55+ "Please use exceptions from the `sqlalchemy.exc` module instead. "
56+ "See https://docs.sqlalchemy.org/en/21/core/exceptions.html for details. "
57+ "This change is part of the migration to SQLAlchemy async support with asyncpg. "
58+ "See migration issue: https://github.com/ITISFoundation/osparc-simcore/issues/4529"
59+ ),
60+ DeprecationWarning ,
61+ stacklevel = 2 ,
62+ )
63+
4964__all__ : tuple [str , ...] = (
5065 "CheckViolation" ,
5166 "DatabaseError" ,
Original file line number Diff line number Diff line change 55"""
66
77import logging
8+ import warnings
89from collections .abc import AsyncIterator
910from typing import Any , cast
1011
2930
3031_logger = logging .getLogger (__name__ )
3132
33+ warnings .warn (
34+ (
35+ "simcore_service_webserver.db._aiopg is deprecated and will be removed in a future release. "
36+ "Please use simcore_service_webserver.db._asyncpg instead. "
37+ "See migration details: https://github.com/ITISFoundation/osparc-simcore/issues/4529"
38+ ),
39+ DeprecationWarning ,
40+ stacklevel = 2 ,
41+ )
42+
3243
3344@retry (** PostgresRetryPolicyUponInitialization (_logger ).kwargs )
3445async def _ensure_pg_ready (
Original file line number Diff line number Diff line change 3535)
3636def setup_db (app : web .Application ):
3737
38- # ensures keys exist
38+ # ensures keys exist DEPRECATED
3939 app [APP_AIOPG_ENGINE_KEY ] = None
4040 assert get_database_engine_legacy (app ) is None # nosec
4141
You can’t perform that action at this time.
0 commit comments