neutron/neutron
Mike Bayer e98a268de4 Propose replacement of ORM from_self()
The from_self() method in SQLAlchemy is currently
being considered for removal from the library,
with a deprecation phase throughout 1.4 and then
removal by SQLAlchemy 2.0.

The from_self() method takes an ORM query object,
turns it into a subquery, then returns a new query
object that will SELECT from that subquery, while transparently
altering subsequent criteria added to the query to
be stated in terms of the subquery.   The current
design direction of SQLAlchemy hopes to
de-emphasize the "transparently altering criteria"
part of the above use case, and to move users towards a
more explicit and model of usage where a subquery should
be created and used explicitly using the aliased()
construct, which is now very mature and can be used in ways
that were not available when from_self() was first introduced.

On the SQLAlchemy side, from_self() has proven to be one
of the most difficult features to maintain and test
as it can easily lead to extremely complicated scenarios, and
while I am also experimenting with some alternatives that
may still retain some of the "automatic translation" features,
those features are still proving to add similar internal
complexity which is having me lean towards the original
plan of removing open-ended "entity translation" features
like that of from_self() at least through the start
of the 2.0 series.

A code search for all of Openstack shows that the
two files modified here are the only usages of the
from_self() method throughout all of searchable Openstack
code.  This speaks to the general obscurity of this method,
although neutron's Subnet code is actually using this
method as intended.    The new approach necessarily changes
some of the method signatures here so that the explicit
"subquery" entity can be passed; code searches again
show that these methods are not being called anywhere
outside, so the query_filter_service_subnets method
becomes the private _query_entity_service_subnets method.

References: https://github.com/sqlalchemy/sqlalchemy/issues/5368

Closes-Bug: #2004263

Change-Id: Icec998873221ac8e6a1566a157b2044c1f6cd7f3
2023-02-01 14:30:37 +00:00
..
agent Merge "Honor debug mode in keepalived-state-change script logs" 2023-01-30 10:49:28 +00:00
api Fix some pylint indentation warnings 2022-11-02 10:11:46 -04:00
cmd Merge "Delete the PB level registers when deleting the duplicated PB" 2023-01-16 14:43:14 +00:00
common [OVN] Introduce the new OVN Neutron Agent 2023-01-19 14:36:39 +00:00
conf Merge "Support for minimum bandwidth rules in tunnelled networks" 2023-01-16 18:59:59 +00:00
core_extensions Revert "Set system_scope='all' in elevated context" 2021-06-15 10:29:20 +02:00
db Use SLQAlchemy ORM "relationship" instead of "relation" 2023-01-25 03:45:26 +01:00
debug Fix some pylint indentation warnings 2022-12-12 11:48:25 -05:00
exceptions Add port-resource-request-groups extension 2021-10-21 14:30:07 +02:00
extensions [API] Add API extension and definition for default SG rules 2023-01-23 11:35:45 +00:00
hacking Fix some pylint indentation warnings 2022-12-12 11:48:25 -05:00
ipam Fix some pylint indentation warnings 2022-12-12 11:48:25 -05:00
locale Imported Translations from Zanata 2023-01-27 03:53:21 +00:00
notifiers Fix some pylint indentation warnings 2022-12-12 11:48:25 -05:00
objects Propose replacement of ORM from_self() 2023-02-01 14:30:37 +00:00
pecan_wsgi Fix some pylint indentation warnings 2022-12-12 11:48:25 -05:00
plugins Propose replacement of ORM from_self() 2023-02-01 14:30:37 +00:00
privileged Bump the minimum pyroute2 version to 0.7.3 2023-01-18 04:43:09 +01:00
profiling Fix some pylint indentation warnings 2022-12-12 11:48:25 -05:00
quota [sqlalchemy-20] Add missing DB context decorator 2022-12-02 02:38:36 +01:00
scheduler Fix some pylint indentation warnings 2022-11-02 10:26:11 -04:00
server Use monkey_patch for neutron API server. 2022-04-28 13:34:36 +00:00
services Merge "Support for minimum bandwidth rules in tunnelled networks" 2023-01-16 18:59:59 +00:00
tests Propose replacement of ORM from_self() 2023-02-01 14:30:37 +00:00
__init__.py Remove usage of six.PY2 2020-05-22 12:59:01 -04:00
_i18n.py
auth.py Add fake_project_id middleware for noauth 2021-07-05 21:18:09 +05:30
manager.py Remove usage of six.add_metaclass 2020-05-21 14:41:18 -04:00
neutron_plugin_base_v2.py Remove usage of six.add_metaclass 2020-05-21 14:41:18 -04:00
opts.py Fix missing [designate] options 2022-11-22 12:00:50 +09:00
policy.py Bump oslo.policy to 3.12.0 2022-05-02 12:47:16 +02:00
service.py Re-use existing ProcessLauncher from wsgi in RPC workers 2020-02-07 14:51:06 +01:00
version.py
worker.py Change process name of neutron-server to match worker role 2019-03-01 14:18:09 -05:00
wsgi.py Fix some pylint indentation warnings 2022-07-01 17:52:59 -04:00