neutron/neutron/tests/unit
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 "Change flag check order in wait_until_address_ready()" 2023-01-26 13:31:21 +00:00
api dhcp/rpc: retrieve network details with segments 2022-09-01 14:48:54 +02:00
cmd Fix remaining typos in comments and tests 2022-07-06 21:20:27 +05:30
common [OVN] Add vnic_type and binding profile capabilities to LSP info 2023-01-18 05:01:21 +01:00
conf [S-RBAC] Allow admin user to do all API requests by default 2022-11-24 09:17:18 +00:00
core_extensions Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
db Allow multiple IPv6 ports on router from same network ml2/ovs+dvr 2023-01-13 12:29:47 +01:00
debug Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
extensions Merge "segment: enable multisegments support for host" 2022-12-23 16:34:03 +00:00
hacking Remove "six" library 2020-07-28 16:55:52 +00:00
ipam Remove exception ``IpAddressAllocationNotFound`` 2022-03-16 16:48:06 +00:00
notifiers Fix test_nova_send_events_* tests 2022-09-06 11:40:10 +02:00
objects [OVN] Add vnic_type and binding profile capabilities to LSP info 2023-01-18 05:01:21 +01:00
pecan_wsgi Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04: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
quota Replace "tenant_id" with "project_id" in Quota engine 2021-09-22 08:27:10 +00:00
scheduler Remove some unnecessary list comprehensions 2022-10-05 17:11:45 -04:00
services Merge "Support for minimum bandwidth rules in tunnelled networks" 2023-01-16 18:59:59 +00:00
tests Merge "Replace assertItemsEqual with assertCountEqual" 2021-04-26 19:12:38 +00:00
__init__.py
_test_extension_portbindings.py Deprecate 'allow_overlapping_ips' config option 2021-10-21 10:56:33 +00:00
dummy_plugin.py Remove Neutron LBaaS 2019-09-20 07:46:06 +00:00
extension_stubs.py
fake_resources.py Merge "[OVN] Prevent maintenance task fail resource stdattr does not exist" 2022-11-28 18:45:40 +00:00
test_auth.py Fix deprecation warnings about oslo.context 2022-08-13 09:08:00 +00:00
test_manager.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_neutron_plugin_base_v2.py
test_opts.py Provide the rpc_response_max_timeout parameter to sriov-agent 2021-06-06 23:56:14 +09:00
test_policy.py Fix deprecation warnings about oslo.context 2022-08-13 09:08:00 +00:00
test_service.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_worker.py Remove the dependency on the "mock" package 2020-04-28 18:05:37 -04:00
test_wsgi.py Fix a deprecation warning about escape sequence 2022-08-13 19:03:19 +09:00
testlib_api.py Remove usage of six.text_type and six.string_type 2020-05-22 14:02:55 -04:00