yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #93417
[Bug 2051171] Re: SQLalchemy 2.0 warning in neutron-lib
Reviewed: https://review.opendev.org/c/openstack/neutron-lib/+/906627
Committed: https://opendev.org/openstack/neutron-lib/commit/7909696a9042f1624f73119b7431531dde3434e7
Submitter: "Zuul (22348)"
Branch: master
commit 7909696a9042f1624f73119b7431531dde3434e7
Author: Rodolfo Alonso Hernandez <ralonsoh@xxxxxxxxxx>
Date: Sat Jan 20 02:00:01 2024 +0000
[sqlalchemy-20] Use sqlalchemy.orm.DeclarativeBase
``declarative_base()`` is superseded by ``DeclarativeBase`` class.
More information in [1].
[1]https://docs.sqlalchemy.org/en/20/changelog/whatsnew_20.html#step-one-orm-declarative-base-is-superseded-by-orm-declarativebase
Closes-Bug: #2051171
Change-Id: I5ddf9573572e52fe87bbfde9732c5af9ce398188
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/2051171
Title:
SQLalchemy 2.0 warning in neutron-lib
Status in neutron:
Fix Released
Bug description:
Running 'tox -e pep8' in neutron-lib or neutron repo generates this
new warning:
/home/bhaley/git/neutron-lib/neutron_lib/db/model_base.py:113: MovedIn20Warning: Deprecated API features detected! These feature(s) are not compatible with SQLAlchemy 2.0. To prevent incompatible upgrades prior to updating applications, ensure requirements files are pinned to "sqlalchemy<2.0". Set environment variable SQLALCHEMY_WARN_20=1 to show all deprecation warnings. Set environment variable SQLALCHEMY_SILENCE_UBER_WARNING=1 to silence this message. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
BASEV2 = declarative.declarative_base(cls=NeutronBaseV2)
Google eventually points in this direction:
https://docs.sqlalchemy.org/en/20/changelog/whatsnew_20.html#step-one-
orm-declarative-base-is-superseded-by-orm-declarativebase
So moving to use sqlalchemy.orm.DeclarativeBase class is the future.
Might be a little tricky to implement as sqlalchemy is currently
pinned in UC:
sqlalchemy===1.4.50
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/2051171/+subscriptions
References