)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"9d07d927dfaa0397618680b4fe0721d810ad3262","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"c3578086_458d5162","updated":"2025-05-26 07:14:03.000000000","message":"recheck openstack-tox-cover","commit_id":"9ae15feb1df308cabe363272c9768c9aaa21412e"}],"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c16a3b9edfbc677c07887f1abb1908670e30fd78","unresolved":true,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"def _network_result_filter_hook(query, filters):"},{"line_number":136,"context_line":"    # This filter matches the provider network attributes, defined in"},{"line_number":137,"context_line":"    # ``neutron_lib.api.definitions.provider_net.ATTRIBUTES``."},{"line_number":138,"context_line":"    attr_to_field \u003d {"},{"line_number":139,"context_line":"        pnet_def.NETWORK_TYPE: segment_db.NetworkSegment.network_type,"},{"line_number":140,"context_line":"        pnet_def.PHYSICAL_NETWORK: segment_db.NetworkSegment.physical_network,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9c06f886_f35140da","line":137,"updated":"2025-05-21 20:55:19.000000000","message":"If there are no filters, should this return early?","commit_id":"9d4a79459aa3d42432e1b7d14cbdb7b4b5ca1f2c"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"0236c876199cd110a6296565c87d4d14b0eb38d8","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"def _network_result_filter_hook(query, filters):"},{"line_number":136,"context_line":"    # This filter matches the provider network attributes, defined in"},{"line_number":137,"context_line":"    # ``neutron_lib.api.definitions.provider_net.ATTRIBUTES``."},{"line_number":138,"context_line":"    attr_to_field \u003d {"},{"line_number":139,"context_line":"        pnet_def.NETWORK_TYPE: segment_db.NetworkSegment.network_type,"},{"line_number":140,"context_line":"        pnet_def.PHYSICAL_NETWORK: segment_db.NetworkSegment.physical_network,"}],"source_content_type":"text/x-python","patch_set":2,"id":"cdf6a67a_bcf13dd2","line":137,"in_reply_to":"9c06f886_f35140da","updated":"2025-05-22 11:25:33.000000000","message":"Well, we check that twice. First in L144 and then in L148. If no attributes are passed, none of these conditions will pass.","commit_id":"9d4a79459aa3d42432e1b7d14cbdb7b4b5ca1f2c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"b9235a192302a20be9a01ba5a1b9d53e7659496c","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"def _network_result_filter_hook(query, filters):"},{"line_number":136,"context_line":"    # This filter matches the provider network attributes, defined in"},{"line_number":137,"context_line":"    # ``neutron_lib.api.definitions.provider_net.ATTRIBUTES``."},{"line_number":138,"context_line":"    attr_to_field \u003d {"},{"line_number":139,"context_line":"        pnet_def.NETWORK_TYPE: segment_db.NetworkSegment.network_type,"},{"line_number":140,"context_line":"        pnet_def.PHYSICAL_NETWORK: segment_db.NetworkSegment.physical_network,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a0bf7e9_8163040f","line":137,"in_reply_to":"cdf6a67a_bcf13dd2","updated":"2025-05-28 18:38:03.000000000","message":"Understood, and the code does do the right thing, sometimes a short-circuit makes it obvious. But I\u0027m fine with it.\n\nif not filters:\n    return query","commit_id":"9d4a79459aa3d42432e1b7d14cbdb7b4b5ca1f2c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"c16a3b9edfbc677c07887f1abb1908670e30fd78","unresolved":true,"context_lines":[{"line_number":156,"context_line":"        else:"},{"line_number":157,"context_line":"            query \u003d query.filter(field \u003d\u003d value)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    return query"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"@registry.has_registry_receivers"}],"source_content_type":"text/x-python","patch_set":2,"id":"e63a5bb7_a1bc0420","line":159,"updated":"2025-05-21 20:55:19.000000000","message":"Based on my above comment, I think we can get here with query being unassigned? or is the passed query arg always valid?","commit_id":"9d4a79459aa3d42432e1b7d14cbdb7b4b5ca1f2c"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"0236c876199cd110a6296565c87d4d14b0eb38d8","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        else:"},{"line_number":157,"context_line":"            query \u003d query.filter(field \u003d\u003d value)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    return query"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"@registry.has_registry_receivers"}],"source_content_type":"text/x-python","patch_set":2,"id":"d1d8d00d_eef5bf17","line":159,"in_reply_to":"e63a5bb7_a1bc0420","updated":"2025-05-22 11:25:33.000000000","message":"But this is happening already.\n1) In L144, if no pnet_def.ATTRIBUTES are in filters, nothing is added to the query.\n2) Same for L148-149. We can improve this for loop making the filter in the condition. I can push a new PS for this.","commit_id":"9d4a79459aa3d42432e1b7d14cbdb7b4b5ca1f2c"}]}
