)]}'
{"mistral/db/v2/sqlalchemy/api.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"3b2e137e0ec1f04288f09e91016f8dde3267eede","unresolved":false,"context_lines":[{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    sort_keys \u003d sort_keys if sort_keys else []"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    if \u0027id\u0027 not in sort_keys:"},{"line_number":182,"context_line":"        sort_keys.append(\u0027id\u0027)"},{"line_number":183,"context_line":"        sort_dirs.append(\u0027asc\u0027) if sort_dirs else None"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    query \u003d db_utils.paginate_query("},{"line_number":186,"context_line":"        query,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4b6375_3a32c211","side":"PARENT","line":183,"range":{"start_line":181,"start_character":4,"end_line":183,"end_character":54},"updated":"2017-10-23 04:11:25.000000000","message":"This was added intentionally to prevent potential endless looping in case of paginated queries. The thing is that if we query pages (using \"marker\" param) w/o applying any sorting then we can\u0027t be sure that we\u0027ll be getting entities that haven\u0027t been already fetched from db. So sorting by id is added to guarantee some order and there\u0027s even a special handling of that (as far as I remember) in SQLAlchemy. But I think this is still wrong because we could check \"limit\" and \"marker\" parameters and add sorting only if we use pagination.","commit_id":"826760fbdc5ac7e73ce747275f091c58f8fb73af"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"7f2991696981a077a5e04f73d19ff64f02ac6a5f","unresolved":false,"context_lines":[{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    sort_keys \u003d sort_keys if sort_keys else []"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    # We should add sorting by id only if we use pagination and have"},{"line_number":182,"context_line":"    # at least one sorting item in the list. Otherwise we can omit it to"},{"line_number":183,"context_line":"    # increase the performance."},{"line_number":184,"context_line":"    if (marker or limit) and sort_keys and \u0027id\u0027 not in sort_keys:"},{"line_number":185,"context_line":"        sort_keys.append(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_2779d72e","line":182,"range":{"start_line":181,"start_character":60,"end_line":182,"end_character":31},"updated":"2017-10-30 04:53:44.000000000","message":"It should be all the way around. \"If we don\u0027t have any sorting items.\"","commit_id":"69d346359aa5279aae04f6f6df029ba9731d7a0c"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"8343377e479e9530e2b141d7ef7afebfe7f874b8","unresolved":false,"context_lines":[{"line_number":181,"context_line":"    # We should add sorting by id only if we use pagination and have"},{"line_number":182,"context_line":"    # at least one sorting item in the list. Otherwise we can omit it to"},{"line_number":183,"context_line":"    # increase the performance."},{"line_number":184,"context_line":"    if (marker or limit) and sort_keys and \u0027id\u0027 not in sort_keys:"},{"line_number":185,"context_line":"        sort_keys.append(\u0027id\u0027)"},{"line_number":186,"context_line":"        sort_dirs.append(\u0027asc\u0027) if sort_dirs else None"},{"line_number":187,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4b6375_697921c6","line":184,"updated":"2017-10-26 16:31:25.000000000","message":"I will temporarily put WIP flag on to discuss this change. This is an API impact, and I want to be sure that everyone\u0027s okay with it.","commit_id":"69d346359aa5279aae04f6f6df029ba9731d7a0c"}],"mistral/utils/rest_utils.py":[{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"3b2e137e0ec1f04288f09e91016f8dde3267eede","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    if fields and \u0027id\u0027 not in fields:"},{"line_number":159,"context_line":"        fields.insert(0, \u0027id\u0027)"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    if sort_keys and \u0027id\u0027 not in sort_keys:"},{"line_number":162,"context_line":"        sort_keys.append(\u0027id\u0027)"},{"line_number":163,"context_line":"        sort_dirs.append(\u0027asc\u0027) if sort_dirs else None"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    validate_query_params(limit, sort_keys, sort_dirs)"},{"line_number":166,"context_line":"    validate_fields(fields, cls.get_fields())"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f4b6375_4d314aec","line":163,"range":{"start_line":161,"start_character":4,"end_line":163,"end_character":54},"updated":"2017-10-23 04:11:25.000000000","message":"See my comment in api.py. I think we should remove this form API layer but keep in DB layer (but just make it smarter).","commit_id":"f69a8c48da978b6d7295f264908af8eb45382f7b"}]}
