)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"7f51db8087ebea979a6a691a619fad35f252514c","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Lujin \u003cluo.lujin@jp.fujitsu.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-10-31 13:40:58 +0900"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Reorder the if check in db/_model_query()"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"After passing to _kwargs_to_filters(), value is modifies to be an"},{"line_number":10,"context_line":"iterable, except if it is a StringMatchingFilterObj. Thus, in"},{"line_number":11,"context_line":"apply_filters(), we need to check if it is a StringMatchingFilterObj"},{"line_number":12,"context_line":"first before assuming it has been modified as an iterable."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I1b43a06f6e35eaa61c6e6770076a167e6ee83987"},{"line_number":15,"context_line":"Closes-Bug: #1724177"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f4b6375_a530e708","line":12,"range":{"start_line":7,"start_character":0,"end_line":12,"end_character":57},"updated":"2017-10-31 22:15:14.000000000","message":"The code looks good, but I think that, for clarity in the project\u0027s history, the commit message can be improved. Consider the following alternative:\n\nReorder checks in apply_filters in db/_model_query\n\nFunction _kwargs_to_filters() in objects/db/api creates a filter\ndictionary where all the values are made iterables except in the case\nof StringMatchingFilterObj objects. As a consequence, when processing\nsuch a filter, function apply_filters() in db/_model_query must check\nif a value is a StringMatchingFilterObj before assuming it is an\niterable","commit_id":"a43a4b459337806c015cccfbb258ef757bf35af6"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"7146e010be6f273104a7ca89cdf14a1411319853","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Lujin \u003cluo.lujin@jp.fujitsu.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2017-10-31 13:40:58 +0900"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Reorder the if check in db/_model_query()"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"After passing to _kwargs_to_filters(), value is modifies to be an"},{"line_number":10,"context_line":"iterable, except if it is a StringMatchingFilterObj. Thus, in"},{"line_number":11,"context_line":"apply_filters(), we need to check if it is a StringMatchingFilterObj"},{"line_number":12,"context_line":"first before assuming it has been modified as an iterable."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I1b43a06f6e35eaa61c6e6770076a167e6ee83987"},{"line_number":15,"context_line":"Closes-Bug: #1724177"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f4b6375_5ee9007e","line":12,"range":{"start_line":7,"start_character":0,"end_line":12,"end_character":57},"in_reply_to":"3f4b6375_a530e708","updated":"2017-11-01 00:51:55.000000000","message":"Thanks! I am bad at wording, :P","commit_id":"a43a4b459337806c015cccfbb258ef757bf35af6"}],"neutron/db/_model_query.py":[{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"65d832e0429125a25d870493e004b1687c741d12","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                    elif value.is_ends:"},{"line_number":202,"context_line":"                        query \u003d query.filter("},{"line_number":203,"context_line":"                            column.endswith(value.ends))"},{"line_number":204,"context_line":"                elif None in value:"},{"line_number":205,"context_line":"                    # in_() operator does not support NULL element so we have"},{"line_number":206,"context_line":"                    # to do multiple equals matches"},{"line_number":207,"context_line":"                    query \u003d query.filter("}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_4c2a972c","line":204,"updated":"2017-10-31 04:47:32.000000000","message":"In [1], Ihar mentioned his concern of assuming value to be an iterable in this line. In the current usage of get_objects() in objects/db/api.py , all the filters are passed to _kwargs_to_filters(), which makes value a list except if it is a StringMatchingFilterObj [2]. Thus, we need to put this after we confirm value is not a StringMatchingFilterObj. \n\nI am seeing tests failing in my other bug fix related to StringMatchingFilterObj in [3]. \n\n[1] https://review.openstack.org/#/c/512908/1/neutron/db/_model_query.py\n[2] https://github.com/openstack/neutron/blob/master/neutron/objects/db/api.py#L39\n[3] http://logs.openstack.org/44/512944/5/check/openstack-tox-py27/241c454/testr_results.html.gz","commit_id":"a43a4b459337806c015cccfbb258ef757bf35af6"}]}
