)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Ildiko Vancsa \u003cildiko.vancsa@ericsson.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-12-17 14:48:19 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"(WIP)Implements complex query functionality for samples"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"New API resource /query/meters has been added"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAATn%2F8%2FlY%3D","line":7,"updated":"2013-12-17 22:57:29.000000000","message":"no need for WIP. You can flag your patches as work in progress. Search for \"Work In Progress\" button.","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"}],"ceilometer/api/controllers/v2.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":903,"context_line":"        #TODO(gibi): this is also defined in the db engines."},{"line_number":904,"context_line":"        #Remove the duplication somehow"},{"line_number":905,"context_line":"        self.complex_operators \u003d [\"and\", \"or\"]"},{"line_number":906,"context_line":"        self.order_directions \u003d [\"ASC\", \"DESC\"]"},{"line_number":907,"context_line":""},{"line_number":908,"context_line":"        self.timestamp_fields \u003d [\"timestamp\", \"state_timestamp\"]"},{"line_number":909,"context_line":"        self.original_query \u003d query"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9IlU%3D","line":906,"updated":"2013-12-16 14:56:30.000000000","message":"Consistent upper/lower-case choice for keywords?","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5ca16af4524ff7e14d5a7688848c6cee34695dd4","unresolved":false,"context_lines":[{"line_number":903,"context_line":"        #TODO(gibi): this is also defined in the db engines."},{"line_number":904,"context_line":"        #Remove the duplication somehow"},{"line_number":905,"context_line":"        self.complex_operators \u003d [\"and\", \"or\"]"},{"line_number":906,"context_line":"        self.order_directions \u003d [\"ASC\", \"DESC\"]"},{"line_number":907,"context_line":""},{"line_number":908,"context_line":"        self.timestamp_fields \u003d [\"timestamp\", \"state_timestamp\"]"},{"line_number":909,"context_line":"        self.original_query \u003d query"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9DDQ%3D","line":906,"in_reply_to":"AAAATn%2F9IlU%3D","updated":"2013-12-17 14:22:55.000000000","message":"Done","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":905,"context_line":"        self.complex_operators \u003d [\"and\", \"or\"]"},{"line_number":906,"context_line":"        self.order_directions \u003d [\"ASC\", \"DESC\"]"},{"line_number":907,"context_line":""},{"line_number":908,"context_line":"        self.timestamp_fields \u003d [\"timestamp\", \"state_timestamp\"]"},{"line_number":909,"context_line":"        self.original_query \u003d query"},{"line_number":910,"context_line":""},{"line_number":911,"context_line":"    def validate(self, visibility_field):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9IjA%3D","line":908,"updated":"2013-12-16 14:56:30.000000000","message":"The state_timestamp field is not used in this patch, I\u0027m assuming that it\u0027s forward-looking to a later patch in the series that relates to alarm filtering?\n\nIf so, it would be better to move its defition into the later patch.","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5ca16af4524ff7e14d5a7688848c6cee34695dd4","unresolved":false,"context_lines":[{"line_number":905,"context_line":"        self.complex_operators \u003d [\"and\", \"or\"]"},{"line_number":906,"context_line":"        self.order_directions \u003d [\"ASC\", \"DESC\"]"},{"line_number":907,"context_line":""},{"line_number":908,"context_line":"        self.timestamp_fields \u003d [\"timestamp\", \"state_timestamp\"]"},{"line_number":909,"context_line":"        self.original_query \u003d query"},{"line_number":910,"context_line":""},{"line_number":911,"context_line":"    def validate(self, visibility_field):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9DDo%3D","line":908,"in_reply_to":"AAAATn%2F9IjA%3D","updated":"2013-12-17 14:22:55.000000000","message":"Done","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":915,"context_line":""},{"line_number":916,"context_line":"        self._validate_filter(self.filter_)"},{"line_number":917,"context_line":"        self._force_visibility(visibility_field)"},{"line_number":918,"context_line":"        self.filter_ \u003d self._replace_isotime_with_datetime(self.filter_)"},{"line_number":919,"context_line":""},{"line_number":920,"context_line":"        self.orderby \u003d self._transform_orderby_list_to_tuples("},{"line_number":921,"context_line":"            self.original_query.orderby or [])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9Ib4%3D","line":918,"updated":"2013-12-16 14:56:30.000000000","message":"Why the trailing underscore on filter_?","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7a7e396e18e8eac7fd59b32663d6d78797823454","unresolved":false,"context_lines":[{"line_number":915,"context_line":""},{"line_number":916,"context_line":"        self._validate_filter(self.filter_)"},{"line_number":917,"context_line":"        self._force_visibility(visibility_field)"},{"line_number":918,"context_line":"        self.filter_ \u003d self._replace_isotime_with_datetime(self.filter_)"},{"line_number":919,"context_line":""},{"line_number":920,"context_line":"        self.orderby \u003d self._transform_orderby_list_to_tuples("},{"line_number":921,"context_line":"            self.original_query.orderby or [])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9G7k%3D","line":918,"in_reply_to":"AAAATn%2F9Ib4%3D","updated":"2013-12-16 18:40:43.000000000","message":"We don\u0027t want to hide the built-in filter function.","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":937,"context_line":"            msg \u003d _(\u0027Length of orderby must be even\u0027)"},{"line_number":938,"context_line":"            raise ClientSideError(msg)"},{"line_number":939,"context_line":""},{"line_number":940,"context_line":"        for i in range(0, len(orderby)):"},{"line_number":941,"context_line":"            if i % 2 \u003d\u003d 0:"},{"line_number":942,"context_line":"                orderby_fields.append(orderby[i])"},{"line_number":943,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9Ih8%3D","line":940,"updated":"2013-12-16 14:56:30.000000000","message":"Lower bound on range is redundant.","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5ca16af4524ff7e14d5a7688848c6cee34695dd4","unresolved":false,"context_lines":[{"line_number":937,"context_line":"            msg \u003d _(\u0027Length of orderby must be even\u0027)"},{"line_number":938,"context_line":"            raise ClientSideError(msg)"},{"line_number":939,"context_line":""},{"line_number":940,"context_line":"        for i in range(0, len(orderby)):"},{"line_number":941,"context_line":"            if i % 2 \u003d\u003d 0:"},{"line_number":942,"context_line":"                orderby_fields.append(orderby[i])"},{"line_number":943,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9DDk%3D","line":940,"in_reply_to":"AAAATn%2F9Ih8%3D","updated":"2013-12-17 14:22:55.000000000","message":"Done","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":959,"context_line":"    def _check_cross_project_references(self, own_project_id,"},{"line_number":960,"context_line":"                                        visibility_field):"},{"line_number":961,"context_line":"        \"\"\"Do not allow other than own_project_id"},{"line_number":962,"context_line":"        \"\"\""},{"line_number":963,"context_line":"        def check_project_id(subfilter):"},{"line_number":964,"context_line":"            if (subfilter[1] \u003d\u003d visibility_field"},{"line_number":965,"context_line":"                    and subfilter[2] !\u003d own_project_id):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9IfY%3D","line":962,"updated":"2013-12-16 14:56:30.000000000","message":"I\u0027m wondering whether we actually need this check, seeing as segregation to the caller\u0027s project ID is already imposed for non-admin callers.\n\nSo for example if non-admin tenant1 submits a query with a query constraint on tenant2, it\u0027s not possible that visibility onto tenant2\u0027s samples are leaked due to the implicit additional constraint on equality with tenant1 added by _restrict_to_project.\n\nOr am I missing something?","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"7a7e396e18e8eac7fd59b32663d6d78797823454","unresolved":false,"context_lines":[{"line_number":959,"context_line":"    def _check_cross_project_references(self, own_project_id,"},{"line_number":960,"context_line":"                                        visibility_field):"},{"line_number":961,"context_line":"        \"\"\"Do not allow other than own_project_id"},{"line_number":962,"context_line":"        \"\"\""},{"line_number":963,"context_line":"        def check_project_id(subfilter):"},{"line_number":964,"context_line":"            if (subfilter[1] \u003d\u003d visibility_field"},{"line_number":965,"context_line":"                    and subfilter[2] !\u003d own_project_id):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9G24%3D","line":962,"in_reply_to":"AAAATn%2F9IfY%3D","updated":"2013-12-16 18:40:43.000000000","message":"You are right segregation is already enforced by adding an extra constraint to the filter expression.\n\nThe reason to raise the exception here is to give a clear indication to the non-admin tenant that she tries to query other than it\u0027s own project. Without this exception the empty result of her query might be misleading as she might not aware of the fact that her query was modified with an extra constraint before it was executed.","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":1001,"context_line":"        else:"},{"line_number":1002,"context_line":"            return filter_"},{"line_number":1003,"context_line":""},{"line_number":1004,"context_line":"    def _convert_to_datetime(self, isotime):"},{"line_number":1005,"context_line":"        try:"},{"line_number":1006,"context_line":"            date_time \u003d timeutils.parse_isotime(isotime)"},{"line_number":1007,"context_line":"            date_time \u003d date_time.replace(tzinfo\u003dNone)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9IPE%3D","line":1004,"updated":"2013-12-16 14:56:30.000000000","message":"@staticmethod?","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5ca16af4524ff7e14d5a7688848c6cee34695dd4","unresolved":false,"context_lines":[{"line_number":1001,"context_line":"        else:"},{"line_number":1002,"context_line":"            return filter_"},{"line_number":1003,"context_line":""},{"line_number":1004,"context_line":"    def _convert_to_datetime(self, isotime):"},{"line_number":1005,"context_line":"        try:"},{"line_number":1006,"context_line":"            date_time \u003d timeutils.parse_isotime(isotime)"},{"line_number":1007,"context_line":"            date_time \u003d date_time.replace(tzinfo\u003dNone)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9DDY%3D","line":1004,"in_reply_to":"AAAATn%2F9IPE%3D","updated":"2013-12-17 14:22:55.000000000","message":"Done","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":1001,"context_line":"        self._validate_filter(self.filter_)"},{"line_number":1002,"context_line":"        self._force_visibility(visibility_field)"},{"line_number":1003,"context_line":"        self.filter_ \u003d self._replace_isotime_with_datetime(self.filter_)"},{"line_number":1004,"context_line":"        self.filter_ \u003d self._convert_complex_operator_to_lower_case("},{"line_number":1005,"context_line":"            self.filter_)"},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"        self.orderby \u003d self._transform_orderby_list_to_tuples("}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2F4k%3D","line":1004,"updated":"2013-12-17 22:57:29.000000000","message":"why the _ at the end?","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"a667839092423af105a300285bac781d2014f21a","unresolved":false,"context_lines":[{"line_number":1001,"context_line":"        self._validate_filter(self.filter_)"},{"line_number":1002,"context_line":"        self._force_visibility(visibility_field)"},{"line_number":1003,"context_line":"        self.filter_ \u003d self._replace_isotime_with_datetime(self.filter_)"},{"line_number":1004,"context_line":"        self.filter_ \u003d self._convert_complex_operator_to_lower_case("},{"line_number":1005,"context_line":"            self.filter_)"},{"line_number":1006,"context_line":""},{"line_number":1007,"context_line":"        self.orderby \u003d self._transform_orderby_list_to_tuples("}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F84a8%3D","line":1004,"in_reply_to":"AAAATn%2F8%2F4k%3D","updated":"2013-12-19 08:17:05.000000000","message":"We tried to avoid hiding the built-in filter function. I renamed it to filter_expr.","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":1039,"context_line":"    def _traverse_postorder(self, tree, visitor):"},{"line_number":1040,"context_line":"        if tree[0].lower() in self.complex_operators:"},{"line_number":1041,"context_line":"            for i, subtree in enumerate(tree[1:]):"},{"line_number":1042,"context_line":"                tree[i+1] \u003d self._traverse_postorder(subtree, visitor)"},{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"        return visitor(tree)"},{"line_number":1045,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2F0Q%3D","line":1042,"updated":"2013-12-17 22:57:29.000000000","message":"there is probably a more efficient way to do this. Is there a need to evaluate the whole sub-tree again? It think it will copy the same subtree. Any changes to subtree will be seen in this scope if we make sure subtree is passed by reference and it is a mutable object.","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"297d6cf1dcb794edb8649af5132bec41beed1537","unresolved":false,"context_lines":[{"line_number":1039,"context_line":"    def _traverse_postorder(self, tree, visitor):"},{"line_number":1040,"context_line":"        if tree[0].lower() in self.complex_operators:"},{"line_number":1041,"context_line":"            for i, subtree in enumerate(tree[1:]):"},{"line_number":1042,"context_line":"                tree[i+1] \u003d self._traverse_postorder(subtree, visitor)"},{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"        return visitor(tree)"},{"line_number":1045,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F86%2B4%3D","line":1042,"in_reply_to":"AAAATn%2F8%2F0Q%3D","updated":"2013-12-18 19:43:34.000000000","message":"Could you elaborate a bit on the inefficiency? This is a simple postorder tree traversal where the _traverse_postorder is called for every subtree only once.\nAlso I don\u0027t see any kind of heavy copying here as subtree is a reference to a list so only the reference is copied not the whole subtree.","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"a1a7d9fb70c0071c1e7f427f768cedd87f490b20","unresolved":false,"context_lines":[{"line_number":1039,"context_line":"    def _traverse_postorder(self, tree, visitor):"},{"line_number":1040,"context_line":"        if tree[0].lower() in self.complex_operators:"},{"line_number":1041,"context_line":"            for i, subtree in enumerate(tree[1:]):"},{"line_number":1042,"context_line":"                tree[i+1] \u003d self._traverse_postorder(subtree, visitor)"},{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"        return visitor(tree)"},{"line_number":1045,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FwhQ%3D","line":1042,"in_reply_to":"AAAATn%2F86%2B4%3D","updated":"2014-01-08 19:59:06.000000000","message":"are you saying that when you return subtree in the traverse function it does not make the a copy. Either way there is not need top return if subtree can be change and tree sees the change.. right. Can you verify that?","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"        if filter_ !\u003d []:"},{"line_number":1087,"context_line":"            return self._traverse_postorder(filter_, replace_isotime)"},{"line_number":1088,"context_line":"        else:"},{"line_number":1089,"context_line":"            return filter_"},{"line_number":1090,"context_line":""},{"line_number":1091,"context_line":"    def _convert_complex_operator_to_lower_case(self, filter_):"},{"line_number":1092,"context_line":"        def convert_complex_operator(subfilter):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2Fyk%3D","line":1089,"updated":"2013-12-17 22:57:29.000000000","message":"Can we avoid this returns by making sure filter_ var is mutable. It think list is mutable so not sure you need the returns and copies you will need later","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":1097,"context_line":"        if filter_ !\u003d []:"},{"line_number":1098,"context_line":"            return self._traverse_postorder(filter_, convert_complex_operator)"},{"line_number":1099,"context_line":"        else:"},{"line_number":1100,"context_line":"            return filter_"},{"line_number":1101,"context_line":""},{"line_number":1102,"context_line":"    @staticmethod"},{"line_number":1103,"context_line":"    def _convert_to_datetime(isotime):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2Fys%3D","line":1100,"updated":"2013-12-17 22:57:29.000000000","message":"Again if we make sure the filter_ is mutable we can probably avoid this returns and copies the go with it","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":1106,"context_line":"            date_time \u003d date_time.replace(tzinfo\u003dNone)"},{"line_number":1107,"context_line":"            return date_time"},{"line_number":1108,"context_line":"        except ValueError:"},{"line_number":1109,"context_line":"            LOG.exception(\"String %s is not a valid isotime\" % isotime)"},{"line_number":1110,"context_line":"            msg \u003d _(\u0027Failed to parse the timestamp value %s\u0027) % isotime"},{"line_number":1111,"context_line":"            raise ClientSideError(msg)"},{"line_number":1112,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2FzI%3D","line":1109,"updated":"2013-12-17 22:57:29.000000000","message":"Translation here too _()","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"a667839092423af105a300285bac781d2014f21a","unresolved":false,"context_lines":[{"line_number":1106,"context_line":"            date_time \u003d date_time.replace(tzinfo\u003dNone)"},{"line_number":1107,"context_line":"            return date_time"},{"line_number":1108,"context_line":"        except ValueError:"},{"line_number":1109,"context_line":"            LOG.exception(\"String %s is not a valid isotime\" % isotime)"},{"line_number":1110,"context_line":"            msg \u003d _(\u0027Failed to parse the timestamp value %s\u0027) % isotime"},{"line_number":1111,"context_line":"            raise ClientSideError(msg)"},{"line_number":1112,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F84as%3D","line":1109,"in_reply_to":"AAAATn%2F8%2FzI%3D","updated":"2013-12-19 08:17:05.000000000","message":"Done","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":1110,"context_line":"            msg \u003d _(\u0027Failed to parse the timestamp value %s\u0027) % isotime"},{"line_number":1111,"context_line":"            raise ClientSideError(msg)"},{"line_number":1112,"context_line":""},{"line_number":1113,"context_line":"    def _validate_filter(self, filter_):"},{"line_number":1114,"context_line":"        def validate(subfilter):"},{"line_number":1115,"context_line":"            if len(subfilter) !\u003d 3:"},{"line_number":1116,"context_line":"                msg \u003d _(\u0027Invalid filter expression %s\u0027) % str(subfilter)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2F34%3D","line":1113,"updated":"2013-12-17 22:57:29.000000000","message":"I would name filter_ different than self.filter_ to avoid confusion later","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":1113,"context_line":"    def _validate_filter(self, filter_):"},{"line_number":1114,"context_line":"        def validate(subfilter):"},{"line_number":1115,"context_line":"            if len(subfilter) !\u003d 3:"},{"line_number":1116,"context_line":"                msg \u003d _(\u0027Invalid filter expression %s\u0027) % str(subfilter)"},{"line_number":1117,"context_line":"                raise ClientSideError(msg)"},{"line_number":1118,"context_line":""},{"line_number":1119,"context_line":"            return subfilter"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2Fzk%3D","line":1116,"updated":"2013-12-17 22:57:29.000000000","message":"I would mention the limit of 3 childs per node here","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"a667839092423af105a300285bac781d2014f21a","unresolved":false,"context_lines":[{"line_number":1113,"context_line":"    def _validate_filter(self, filter_):"},{"line_number":1114,"context_line":"        def validate(subfilter):"},{"line_number":1115,"context_line":"            if len(subfilter) !\u003d 3:"},{"line_number":1116,"context_line":"                msg \u003d _(\u0027Invalid filter expression %s\u0027) % str(subfilter)"},{"line_number":1117,"context_line":"                raise ClientSideError(msg)"},{"line_number":1118,"context_line":""},{"line_number":1119,"context_line":"            return subfilter"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F84ao%3D","line":1116,"in_reply_to":"AAAATn%2F8%2Fzk%3D","updated":"2013-12-19 08:17:05.000000000","message":"Done","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4fda48b40bb924f9a8c14e8a3aa3fe506a9a5010","unresolved":false,"context_lines":[{"line_number":999,"context_line":"    def validate(self, visibility_field):"},{"line_number":1000,"context_line":"        \"\"\"Validates the query content and does the necessary transformations"},{"line_number":1001,"context_line":"        \"\"\""},{"line_number":1002,"context_line":"        #Default is \"[]\" to be able to append visibility information."},{"line_number":1003,"context_line":"        self.filter_expr \u003d json.loads(self.original_query.filter or \"[]\")"},{"line_number":1004,"context_line":""},{"line_number":1005,"context_line":"        self._validate_filter(self.filter_expr)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F66c%3D","line":1002,"updated":"2014-01-06 19:32:30.000000000","message":"single space after #\n# Default is ...","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"f0145cdc1ec8cd6ff4537fa7702094efa9c35fcb","unresolved":false,"context_lines":[{"line_number":999,"context_line":"    def validate(self, visibility_field):"},{"line_number":1000,"context_line":"        \"\"\"Validates the query content and does the necessary transformations"},{"line_number":1001,"context_line":"        \"\"\""},{"line_number":1002,"context_line":"        #Default is \"[]\" to be able to append visibility information."},{"line_number":1003,"context_line":"        self.filter_expr \u003d json.loads(self.original_query.filter or \"[]\")"},{"line_number":1004,"context_line":""},{"line_number":1005,"context_line":"        self._validate_filter(self.filter_expr)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F3g8%3D","line":1002,"in_reply_to":"AAAAUH%2F%2F66c%3D","updated":"2014-01-07 13:33:44.000000000","message":"Done","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4fda48b40bb924f9a8c14e8a3aa3fe506a9a5010","unresolved":false,"context_lines":[{"line_number":1069,"context_line":""},{"line_number":1070,"context_line":"    def _force_visibility(self, visibility_field):"},{"line_number":1071,"context_line":"        \"\"\"If the tenant is not admin insert an extra"},{"line_number":1072,"context_line":"        \"and \u003cvisibility_field\u003e\u003d\u003ctenat\u0027s project_id\u003e\" clause to the query"},{"line_number":1073,"context_line":"        \"\"\""},{"line_number":1074,"context_line":"        authorized_project \u003d acl.get_limited_to_project(pecan.request.headers)"},{"line_number":1075,"context_line":"        is_admin \u003d authorized_project is None"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F66s%3D","line":1072,"updated":"2014-01-06 19:32:30.000000000","message":"tenant","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"f0145cdc1ec8cd6ff4537fa7702094efa9c35fcb","unresolved":false,"context_lines":[{"line_number":1069,"context_line":""},{"line_number":1070,"context_line":"    def _force_visibility(self, visibility_field):"},{"line_number":1071,"context_line":"        \"\"\"If the tenant is not admin insert an extra"},{"line_number":1072,"context_line":"        \"and \u003cvisibility_field\u003e\u003d\u003ctenat\u0027s project_id\u003e\" clause to the query"},{"line_number":1073,"context_line":"        \"\"\""},{"line_number":1074,"context_line":"        authorized_project \u003d acl.get_limited_to_project(pecan.request.headers)"},{"line_number":1075,"context_line":"        is_admin \u003d authorized_project is None"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F3g4%3D","line":1072,"in_reply_to":"AAAAUH%2F%2F66s%3D","updated":"2014-01-07 13:33:44.000000000","message":"Done","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4fda48b40bb924f9a8c14e8a3aa3fe506a9a5010","unresolved":false,"context_lines":[{"line_number":1090,"context_line":"            if subfilter[1] in self.timestamp_fields:"},{"line_number":1091,"context_line":"                date_time \u003d self._convert_to_datetime(subfilter[2])"},{"line_number":1092,"context_line":"                return [subfilter[0], subfilter[1], date_time]"},{"line_number":1093,"context_line":"            else:"},{"line_number":1094,"context_line":"                return subfilter"},{"line_number":1095,"context_line":""},{"line_number":1096,"context_line":"        if filter_expr !\u003d []:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F66A%3D","line":1093,"updated":"2014-01-06 19:32:30.000000000","message":"don\u0027t need else:","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"f0145cdc1ec8cd6ff4537fa7702094efa9c35fcb","unresolved":false,"context_lines":[{"line_number":1090,"context_line":"            if subfilter[1] in self.timestamp_fields:"},{"line_number":1091,"context_line":"                date_time \u003d self._convert_to_datetime(subfilter[2])"},{"line_number":1092,"context_line":"                return [subfilter[0], subfilter[1], date_time]"},{"line_number":1093,"context_line":"            else:"},{"line_number":1094,"context_line":"                return subfilter"},{"line_number":1095,"context_line":""},{"line_number":1096,"context_line":"        if filter_expr !\u003d []:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F3g0%3D","line":1093,"in_reply_to":"AAAAUH%2F%2F66A%3D","updated":"2014-01-07 13:33:44.000000000","message":"Done","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4fda48b40bb924f9a8c14e8a3aa3fe506a9a5010","unresolved":false,"context_lines":[{"line_number":1095,"context_line":""},{"line_number":1096,"context_line":"        if filter_expr !\u003d []:"},{"line_number":1097,"context_line":"            return self._traverse_postorder(filter_expr, replace_isotime)"},{"line_number":1098,"context_line":"        else:"},{"line_number":1099,"context_line":"            return filter_expr"},{"line_number":1100,"context_line":""},{"line_number":1101,"context_line":"    def _convert_operator_to_lower_case(self, filter_expr):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F658%3D","line":1098,"updated":"2014-01-06 19:32:30.000000000","message":"don\u0027t need else:","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"f0145cdc1ec8cd6ff4537fa7702094efa9c35fcb","unresolved":false,"context_lines":[{"line_number":1095,"context_line":""},{"line_number":1096,"context_line":"        if filter_expr !\u003d []:"},{"line_number":1097,"context_line":"            return self._traverse_postorder(filter_expr, replace_isotime)"},{"line_number":1098,"context_line":"        else:"},{"line_number":1099,"context_line":"            return filter_expr"},{"line_number":1100,"context_line":""},{"line_number":1101,"context_line":"    def _convert_operator_to_lower_case(self, filter_expr):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F3gw%3D","line":1098,"in_reply_to":"AAAAUH%2F%2F658%3D","updated":"2014-01-07 13:33:44.000000000","message":"Done","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4fda48b40bb924f9a8c14e8a3aa3fe506a9a5010","unresolved":false,"context_lines":[{"line_number":1106,"context_line":"        if filter_expr !\u003d []:"},{"line_number":1107,"context_line":"            return self._traverse_postorder(filter_expr,"},{"line_number":1108,"context_line":"                                            convert_operator)"},{"line_number":1109,"context_line":"        else:"},{"line_number":1110,"context_line":"            return filter_expr"},{"line_number":1111,"context_line":""},{"line_number":1112,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F654%3D","line":1109,"updated":"2014-01-06 19:32:30.000000000","message":"Don\u0027t need else:","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"f0145cdc1ec8cd6ff4537fa7702094efa9c35fcb","unresolved":false,"context_lines":[{"line_number":1106,"context_line":"        if filter_expr !\u003d []:"},{"line_number":1107,"context_line":"            return self._traverse_postorder(filter_expr,"},{"line_number":1108,"context_line":"                                            convert_operator)"},{"line_number":1109,"context_line":"        else:"},{"line_number":1110,"context_line":"            return filter_expr"},{"line_number":1111,"context_line":""},{"line_number":1112,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F3go%3D","line":1109,"in_reply_to":"AAAAUH%2F%2F654%3D","updated":"2014-01-07 13:33:44.000000000","message":"Done","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"4e13ccae300d9259f26939b7c7b576c804d94d4a","unresolved":false,"context_lines":[{"line_number":975,"context_line":""},{"line_number":976,"context_line":""},{"line_number":977,"context_line":"class ComplexQuery(_Base):"},{"line_number":978,"context_line":"    \"\"\"Holds a sample query encoded in json"},{"line_number":979,"context_line":"    \"\"\""},{"line_number":980,"context_line":""},{"line_number":981,"context_line":"    filter \u003d wtypes.text"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F3EQ%3D","line":978,"updated":"2014-01-07 16:43:38.000000000","message":"Missing dot at the end","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"4e13ccae300d9259f26939b7c7b576c804d94d4a","unresolved":false,"context_lines":[{"line_number":976,"context_line":""},{"line_number":977,"context_line":"class ComplexQuery(_Base):"},{"line_number":978,"context_line":"    \"\"\"Holds a sample query encoded in json"},{"line_number":979,"context_line":"    \"\"\""},{"line_number":980,"context_line":""},{"line_number":981,"context_line":"    filter \u003d wtypes.text"},{"line_number":982,"context_line":"    \"The filter expression encoded in json\""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F3D0%3D","line":979,"updated":"2014-01-07 16:43:38.000000000","message":"I know that whole file is formatted wrong, but \"\"\" should be on previous line","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"4e13ccae300d9259f26939b7c7b576c804d94d4a","unresolved":false,"context_lines":[{"line_number":979,"context_line":"    \"\"\""},{"line_number":980,"context_line":""},{"line_number":981,"context_line":"    filter \u003d wtypes.text"},{"line_number":982,"context_line":"    \"The filter expression encoded in json\""},{"line_number":983,"context_line":""},{"line_number":984,"context_line":"    orderby \u003d [wtypes.text]"},{"line_number":985,"context_line":"    \"The dict of field names : ASC/DESC specifing the ordering of the result\""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F3GQ%3D","line":982,"updated":"2014-01-07 16:43:38.000000000","message":"I think that this should be a comment (e.g. #)","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"4e13ccae300d9259f26939b7c7b576c804d94d4a","unresolved":false,"context_lines":[{"line_number":992,"context_line":"    def __init__(self, query):"},{"line_number":993,"context_line":"        self.complex_operators \u003d [\"and\", \"or\"]"},{"line_number":994,"context_line":"        self.order_directions \u003d [\"asc\", \"desc\"]"},{"line_number":995,"context_line":""},{"line_number":996,"context_line":"        self.timestamp_fields \u003d [\"timestamp\"]"},{"line_number":997,"context_line":"        self.original_query \u003d query"},{"line_number":998,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F2xo%3D","line":995,"updated":"2014-01-07 16:43:38.000000000","message":"I think that this line could be removed..","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"4e13ccae300d9259f26939b7c7b576c804d94d4a","unresolved":false,"context_lines":[{"line_number":996,"context_line":"        self.timestamp_fields \u003d [\"timestamp\"]"},{"line_number":997,"context_line":"        self.original_query \u003d query"},{"line_number":998,"context_line":""},{"line_number":999,"context_line":"    def validate(self, visibility_field):"},{"line_number":1000,"context_line":"        \"\"\"Validates the query content and does the necessary transformations"},{"line_number":1001,"context_line":"        \"\"\""},{"line_number":1002,"context_line":"        # Default is \"[]\" to be able to append visibility information."}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F204%3D","line":999,"updated":"2014-01-07 16:43:38.000000000","message":"For validation I would strongly recommend to use jsonschema","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"4e13ccae300d9259f26939b7c7b576c804d94d4a","unresolved":false,"context_lines":[{"line_number":997,"context_line":"        self.original_query \u003d query"},{"line_number":998,"context_line":""},{"line_number":999,"context_line":"    def validate(self, visibility_field):"},{"line_number":1000,"context_line":"        \"\"\"Validates the query content and does the necessary transformations"},{"line_number":1001,"context_line":"        \"\"\""},{"line_number":1002,"context_line":"        # Default is \"[]\" to be able to append visibility information."},{"line_number":1003,"context_line":"        self.filter_expr \u003d json.loads(self.original_query.filter or \"[]\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F3FA%3D","line":1000,"updated":"2014-01-07 16:43:38.000000000","message":"Missing dot, \n\nAs well validation \u0026 transformations should be separated methods.\n\nsteps: \n\n1) Validate input syntax by json schema\n\n2) Transform object to required type\n\n3) Validate semantic \n\n\nIn other way it becomes real hard for analyzing what is here happening.","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"4e13ccae300d9259f26939b7c7b576c804d94d4a","unresolved":false,"context_lines":[{"line_number":1002,"context_line":"        # Default is \"[]\" to be able to append visibility information."},{"line_number":1003,"context_line":"        self.filter_expr \u003d json.loads(self.original_query.filter or \"[]\")"},{"line_number":1004,"context_line":""},{"line_number":1005,"context_line":"        self._validate_filter(self.filter_expr)"},{"line_number":1006,"context_line":"        self._force_visibility(visibility_field)"},{"line_number":1007,"context_line":"        self.filter_expr \u003d self._replace_isotime_with_datetime("},{"line_number":1008,"context_line":"            self.filter_expr)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F2z0%3D","line":1005,"updated":"2014-01-07 16:43:38.000000000","message":"_validate_* methods shouldn\u0027t make any transformations","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"4e13ccae300d9259f26939b7c7b576c804d94d4a","unresolved":false,"context_lines":[{"line_number":1003,"context_line":"        self.filter_expr \u003d json.loads(self.original_query.filter or \"[]\")"},{"line_number":1004,"context_line":""},{"line_number":1005,"context_line":"        self._validate_filter(self.filter_expr)"},{"line_number":1006,"context_line":"        self._force_visibility(visibility_field)"},{"line_number":1007,"context_line":"        self.filter_expr \u003d self._replace_isotime_with_datetime("},{"line_number":1008,"context_line":"            self.filter_expr)"},{"line_number":1009,"context_line":"        self.filter_expr \u003d self._convert_operator_to_lower_case("}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F2sk%3D","line":1006,"updated":"2014-01-07 16:43:38.000000000","message":"as it\u0027s hardcoded to project_id, do we actually need it? \n\nalso could be it renamed to:\nself._restrict_by_user_project_id() ?","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"f55ffdf79d8d99370830d6f009cd5fb5b9d64dd7","unresolved":false,"context_lines":[{"line_number":1003,"context_line":"        self.filter_expr \u003d json.loads(self.original_query.filter or \"[]\")"},{"line_number":1004,"context_line":""},{"line_number":1005,"context_line":"        self._validate_filter(self.filter_expr)"},{"line_number":1006,"context_line":"        self._force_visibility(visibility_field)"},{"line_number":1007,"context_line":"        self.filter_expr \u003d self._replace_isotime_with_datetime("},{"line_number":1008,"context_line":"            self.filter_expr)"},{"line_number":1009,"context_line":"        self.filter_expr \u003d self._convert_operator_to_lower_case("}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F2lI%3D","line":1006,"in_reply_to":"AAAAUH%2F%2F2sk%3D","updated":"2014-01-07 17:01:18.000000000","message":"It will be used for alarms and alarm history as well, so we implemented the function this way to be able to reuse for the further patch sets.","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"4e13ccae300d9259f26939b7c7b576c804d94d4a","unresolved":false,"context_lines":[{"line_number":1026,"context_line":"            msg \u003d _(\u0027Limit should be positive\u0027)"},{"line_number":1027,"context_line":"            raise ClientSideError(msg)"},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"    def _transform_orderby_list_to_tuples(self, orderby):"},{"line_number":1030,"context_line":"        orderby_fields \u003d []"},{"line_number":1031,"context_line":"        orderby_directions \u003d []"},{"line_number":1032,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F2qk%3D","line":1029,"updated":"2014-01-07 16:43:38.000000000","message":"If I say before all input is validate by jsonschema then this method will look like:\n\n  return [(orderby[i], orderby[i+1]) for i in range(0, len(orderby), 2)]","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"b76709b99f787534211c65494e9dce22eb70eec0","unresolved":false,"context_lines":[{"line_number":1049,"context_line":"    def _traverse_postorder(self, tree, visitor):"},{"line_number":1050,"context_line":"        if tree[0].lower() in self.complex_operators:"},{"line_number":1051,"context_line":"            for i, subtree in enumerate(tree[1:]):"},{"line_number":1052,"context_line":"                tree[i+1] \u003d self._traverse_postorder(subtree, visitor)"},{"line_number":1053,"context_line":""},{"line_number":1054,"context_line":"        return visitor(tree)"},{"line_number":1055,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2FwbM%3D","line":1052,"updated":"2014-01-08 20:16:42.000000000","message":"Is subtree variable mutable? If it is there is not need to assign to tree[i+1]","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"334abb66f01d03f2659cc0de533765d92c175fa6","unresolved":false,"context_lines":[{"line_number":1049,"context_line":"    def _traverse_postorder(self, tree, visitor):"},{"line_number":1050,"context_line":"        if tree[0].lower() in self.complex_operators:"},{"line_number":1051,"context_line":"            for i, subtree in enumerate(tree[1:]):"},{"line_number":1052,"context_line":"                tree[i+1] \u003d self._traverse_postorder(subtree, visitor)"},{"line_number":1053,"context_line":""},{"line_number":1054,"context_line":"        return visitor(tree)"},{"line_number":1055,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2FltQ%3D","line":1052,"in_reply_to":"AAAAUH%2F%2FwbM%3D","updated":"2014-01-10 18:17:01.000000000","message":"Done.\n\nDue to the new syntax of the expression tree, traversing has changed significantly.","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"4e13ccae300d9259f26939b7c7b576c804d94d4a","unresolved":false,"context_lines":[{"line_number":1983,"context_line":"    @wsme_pecan.wsexpose([Sample], body\u003dComplexQuery)"},{"line_number":1984,"context_line":"    def post(self, body):"},{"line_number":1985,"context_line":"        query \u003d ValidatedComplexQuery(body)"},{"line_number":1986,"context_line":"        query.validate(visibility_field\u003d\"project_id\")"},{"line_number":1987,"context_line":"        conn \u003d pecan.request.storage_conn"},{"line_number":1988,"context_line":"        return [Sample.from_db_model(s)"},{"line_number":1989,"context_line":"                for s in conn.query_samples(query.filter_expr,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F2yU%3D","line":1986,"updated":"2014-01-07 16:43:38.000000000","message":"why \"project_id\" is hardcoded here?","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"f55ffdf79d8d99370830d6f009cd5fb5b9d64dd7","unresolved":false,"context_lines":[{"line_number":1983,"context_line":"    @wsme_pecan.wsexpose([Sample], body\u003dComplexQuery)"},{"line_number":1984,"context_line":"    def post(self, body):"},{"line_number":1985,"context_line":"        query \u003d ValidatedComplexQuery(body)"},{"line_number":1986,"context_line":"        query.validate(visibility_field\u003d\"project_id\")"},{"line_number":1987,"context_line":"        conn \u003d pecan.request.storage_conn"},{"line_number":1988,"context_line":"        return [Sample.from_db_model(s)"},{"line_number":1989,"context_line":"                for s in conn.query_samples(query.filter_expr,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F2kg%3D","line":1986,"in_reply_to":"AAAAUH%2F%2F2yU%3D","updated":"2014-01-07 17:01:18.000000000","message":"See my comment above related to the _force_visibility function.","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"99e43ddca6a52472e72325df7aee673068b04610","unresolved":false,"context_lines":[{"line_number":985,"context_line":"    \"The dict of field names : ASC/DESC specifing the ordering of the result\""},{"line_number":986,"context_line":""},{"line_number":987,"context_line":"    limit \u003d int"},{"line_number":988,"context_line":"    \"The number of results to be returned\""},{"line_number":989,"context_line":""},{"line_number":990,"context_line":""},{"line_number":991,"context_line":"class ValidatedComplexQuery(object):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FF0c%3D","line":988,"updated":"2014-01-17 15:12:54.000000000","message":"The *maximum* number of results to be returned","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5348b232a2085b809d2d6e4864b8dbcd8ecab513","unresolved":false,"context_lines":[{"line_number":985,"context_line":"    \"The dict of field names : ASC/DESC specifing the ordering of the result\""},{"line_number":986,"context_line":""},{"line_number":987,"context_line":"    limit \u003d int"},{"line_number":988,"context_line":"    \"The number of results to be returned\""},{"line_number":989,"context_line":""},{"line_number":990,"context_line":""},{"line_number":991,"context_line":"class ValidatedComplexQuery(object):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FFg4%3D","line":988,"in_reply_to":"AAAAUH%2F%2FF0c%3D","updated":"2014-01-17 18:04:50.000000000","message":"Done","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"ce2af764c533b91b2323deb75f8f4366b0807341","unresolved":false,"context_lines":[{"line_number":991,"context_line":"class ValidatedComplexQuery(object):"},{"line_number":992,"context_line":"    def __init__(self, query):"},{"line_number":993,"context_line":"        self.complex_operators \u003d [\"and\", \"or\"]"},{"line_number":994,"context_line":""},{"line_number":995,"context_line":"        order_directions \u003d [\"asc\", \"desc\"]"},{"line_number":996,"context_line":"        complex_ops \u003d self._list_to_regexp(self.complex_operators)"},{"line_number":997,"context_line":"        simple_ops \u003d [\"\u003d\", \"!\u003d\", \"\u003c\", \"\u003e\", \"\u003c\u003d\", \"\u003d\u003c\", \"\u003e\u003d\", \"\u003d\u003e\"]"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FL%2BA%3D","line":994,"updated":"2014-01-16 16:45:46.000000000","message":"It seems to me that all of this is static and should be defined at the class level to avoid redefining it at each new instance.","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"873d4d1dcc79405e11a7bd07767f761f1f5b8264","unresolved":false,"context_lines":[{"line_number":991,"context_line":"class ValidatedComplexQuery(object):"},{"line_number":992,"context_line":"    def __init__(self, query):"},{"line_number":993,"context_line":"        self.complex_operators \u003d [\"and\", \"or\"]"},{"line_number":994,"context_line":""},{"line_number":995,"context_line":"        order_directions \u003d [\"asc\", \"desc\"]"},{"line_number":996,"context_line":"        complex_ops \u003d self._list_to_regexp(self.complex_operators)"},{"line_number":997,"context_line":"        simple_ops \u003d [\"\u003d\", \"!\u003d\", \"\u003c\", \"\u003e\", \"\u003c\u003d\", \"\u003d\u003c\", \"\u003e\u003d\", \"\u003d\u003e\"]"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FGCc%3D","line":994,"in_reply_to":"AAAAUH%2F%2FL%2BA%3D","updated":"2014-01-17 14:35:15.000000000","message":"Yes, you\u0027re right at this point. There will be some dynamic parts, when the field name validation comes into the picture, so I pulled out the structure now from __init__ and when it is needed I modify only the dynamic elements in the field validation patch set.\n\nDone.","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"ce2af764c533b91b2323deb75f8f4366b0807341","unresolved":false,"context_lines":[{"line_number":1050,"context_line":"        self.timestamp_fields \u003d [\"timestamp\"]"},{"line_number":1051,"context_line":"        self.original_query \u003d query"},{"line_number":1052,"context_line":""},{"line_number":1053,"context_line":"    def _list_to_regexp(self, items):"},{"line_number":1054,"context_line":"        regexp \u003d [\"^%s$\" % item for item in items]"},{"line_number":1055,"context_line":"        regexp \u003d \"|\".join(regexp)"},{"line_number":1056,"context_line":"        regexp \u003d \"(?i)\" + regexp"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FL9s%3D","line":1053,"updated":"2014-01-16 16:45:46.000000000","message":"@staticmethod","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"873d4d1dcc79405e11a7bd07767f761f1f5b8264","unresolved":false,"context_lines":[{"line_number":1050,"context_line":"        self.timestamp_fields \u003d [\"timestamp\"]"},{"line_number":1051,"context_line":"        self.original_query \u003d query"},{"line_number":1052,"context_line":""},{"line_number":1053,"context_line":"    def _list_to_regexp(self, items):"},{"line_number":1054,"context_line":"        regexp \u003d [\"^%s$\" % item for item in items]"},{"line_number":1055,"context_line":"        regexp \u003d \"|\".join(regexp)"},{"line_number":1056,"context_line":"        regexp \u003d \"(?i)\" + regexp"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FGBk%3D","line":1053,"in_reply_to":"AAAAUH%2F%2FL9s%3D","updated":"2014-01-17 14:35:15.000000000","message":"This function was pulled out from this class to module level, so to be callable from class level.","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"ce2af764c533b91b2323deb75f8f4366b0807341","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"            msg \u003d _(\u0027Limit should be positive\u0027)"},{"line_number":1087,"context_line":"            raise ClientSideError(msg)"},{"line_number":1088,"context_line":""},{"line_number":1089,"context_line":"    def _convert_orderby_to_lower_case(self, orderby_fields):"},{"line_number":1090,"context_line":"        orderby_expression \u003d []"},{"line_number":1091,"context_line":"        for orderby_field in orderby_fields:"},{"line_number":1092,"context_line":"            field_name \u003d orderby_field.keys()[0]"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FL4s%3D","line":1089,"updated":"2014-01-16 16:45:46.000000000","message":"@staticmethod","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"873d4d1dcc79405e11a7bd07767f761f1f5b8264","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"            msg \u003d _(\u0027Limit should be positive\u0027)"},{"line_number":1087,"context_line":"            raise ClientSideError(msg)"},{"line_number":1088,"context_line":""},{"line_number":1089,"context_line":"    def _convert_orderby_to_lower_case(self, orderby_fields):"},{"line_number":1090,"context_line":"        orderby_expression \u003d []"},{"line_number":1091,"context_line":"        for orderby_field in orderby_fields:"},{"line_number":1092,"context_line":"            field_name \u003d orderby_field.keys()[0]"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FGBc%3D","line":1089,"in_reply_to":"AAAAUH%2F%2FL4s%3D","updated":"2014-01-17 14:35:15.000000000","message":"Done","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"99e43ddca6a52472e72325df7aee673068b04610","unresolved":false,"context_lines":[{"line_number":1092,"context_line":"            field_name \u003d orderby_field.keys()[0]"},{"line_number":1093,"context_line":"            order \u003d orderby_field.values()[0].lower()"},{"line_number":1094,"context_line":"            orderby \u003d {field_name: order}"},{"line_number":1095,"context_line":"            orderby_expression.append(orderby)"},{"line_number":1096,"context_line":""},{"line_number":1097,"context_line":"        return orderby_expression"},{"line_number":1098,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FF1Y%3D","line":1095,"updated":"2014-01-17 15:12:54.000000000","message":"The docstring for orderby is:\n\n  \"The dict of field names : ASC/DESC specifing the ordering of the result\" \n\nthe prularization of field name*s* suggests to me that there can be multiple orderby fields in a single dict.\n\nWhereas the selection of the zero\u0027th item in the keys and values means IIUC that these dicts can only specify a single order field, i.e.\n\n  _convert_orderby_to_lower_case([{\u0027project_id\u0027: \u0027DeSc\u0027, \u0027resouRce_id\u0027: \u0027AsC\u0027}])\n\n    -\u003e [{\u0027project_id\u0027: \u0027desc\u0027}]\n\nwhereas for multiple single-element dicts:\n\n  _convert_orderby_to_lower_case([{\u0027project_id\u0027: \u0027DeSc\u0027}, {\u0027resouRce_id\u0027: \u0027AsC\u0027}])\n\n    -\u003e [{\u0027project_id\u0027: \u0027desc\u0027}, {\u0027resouRce_id\u0027: \u0027asc\u0027}]\n\nThis seems confusing. Does the schema currently reject orderby dicts containing more than a single mapping? \n\nAlso could the _convert_orderby_to_lower_case naming be made more generic, e.g. lowercase_values() and factored out to a utils module to avoid disrupting the main logical flow on the API code?","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5348b232a2085b809d2d6e4864b8dbcd8ecab513","unresolved":false,"context_lines":[{"line_number":1092,"context_line":"            field_name \u003d orderby_field.keys()[0]"},{"line_number":1093,"context_line":"            order \u003d orderby_field.values()[0].lower()"},{"line_number":1094,"context_line":"            orderby \u003d {field_name: order}"},{"line_number":1095,"context_line":"            orderby_expression.append(orderby)"},{"line_number":1096,"context_line":""},{"line_number":1097,"context_line":"        return orderby_expression"},{"line_number":1098,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FFlQ%3D","line":1095,"in_reply_to":"AAAAUH%2F%2FF1Y%3D","updated":"2014-01-17 18:04:50.000000000","message":"Sorry, my doc string is under the refactor process within documenting this feature, so I will change it now to be correct. The accepted format is a list of multiple single-element dicts, like you wrote: [{\u0027project_id\u0027: \u0027DeSc\u0027}, {\u0027resource_id\u0027: \u0027AsC\u0027}].","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"ce2af764c533b91b2323deb75f8f4366b0807341","unresolved":false,"context_lines":[{"line_number":1093,"context_line":"            order \u003d orderby_field.values()[0].lower()"},{"line_number":1094,"context_line":"            orderby \u003d {field_name: order}"},{"line_number":1095,"context_line":"            orderby_expression.append(orderby)"},{"line_number":1096,"context_line":""},{"line_number":1097,"context_line":"        return orderby_expression"},{"line_number":1098,"context_line":""},{"line_number":1099,"context_line":"    def _traverse_postorder(self, tree, visitor):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FL4A%3D","line":1096,"updated":"2014-01-16 16:45:46.000000000","message":"Looks very complicated to do:\n\nreturn [{f.keys()[0]: f.values()[0].lower()} for f in orderby_fields]","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"873d4d1dcc79405e11a7bd07767f761f1f5b8264","unresolved":false,"context_lines":[{"line_number":1093,"context_line":"            order \u003d orderby_field.values()[0].lower()"},{"line_number":1094,"context_line":"            orderby \u003d {field_name: order}"},{"line_number":1095,"context_line":"            orderby_expression.append(orderby)"},{"line_number":1096,"context_line":""},{"line_number":1097,"context_line":"        return orderby_expression"},{"line_number":1098,"context_line":""},{"line_number":1099,"context_line":"    def _traverse_postorder(self, tree, visitor):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FGAk%3D","line":1096,"in_reply_to":"AAAAUH%2F%2FL4A%3D","updated":"2014-01-17 14:35:15.000000000","message":"Thanks. I usually try to write a human readable code, but it not always worth it.","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"99e43ddca6a52472e72325df7aee673068b04610","unresolved":false,"context_lines":[{"line_number":1151,"context_line":"            key \u003d subfilter.keys()[0]"},{"line_number":1152,"context_line":"            value \u003d subfilter[key]"},{"line_number":1153,"context_line":"            del subfilter[key]"},{"line_number":1154,"context_line":"            subfilter[key.lower()] \u003d value"},{"line_number":1155,"context_line":""},{"line_number":1156,"context_line":"        self._traverse_postorder(filter_expr, convert_operator)"},{"line_number":1157,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FF0o%3D","line":1154,"updated":"2014-01-17 15:12:54.000000000","message":"Could this be made generic, e.g. lowercase_keys() and moved out to a utils module?","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5348b232a2085b809d2d6e4864b8dbcd8ecab513","unresolved":false,"context_lines":[{"line_number":1151,"context_line":"            key \u003d subfilter.keys()[0]"},{"line_number":1152,"context_line":"            value \u003d subfilter[key]"},{"line_number":1153,"context_line":"            del subfilter[key]"},{"line_number":1154,"context_line":"            subfilter[key.lower()] \u003d value"},{"line_number":1155,"context_line":""},{"line_number":1156,"context_line":"        self._traverse_postorder(filter_expr, convert_operator)"},{"line_number":1157,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FFWc%3D","line":1154,"in_reply_to":"AAAAUH%2F%2FF0o%3D","updated":"2014-01-17 18:04:50.000000000","message":"Done","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"99e43ddca6a52472e72325df7aee673068b04610","unresolved":false,"context_lines":[{"line_number":2026,"context_line":"    @wsme_pecan.wsexpose([Sample], body\u003dComplexQuery)"},{"line_number":2027,"context_line":"    def post(self, body):"},{"line_number":2028,"context_line":"        query \u003d ValidatedComplexQuery(body)"},{"line_number":2029,"context_line":"        query.validate(visibility_field\u003d\"project_id\")"},{"line_number":2030,"context_line":"        conn \u003d pecan.request.storage_conn"},{"line_number":2031,"context_line":"        return [Sample.from_db_model(s)"},{"line_number":2032,"context_line":"                for s in conn.query_samples(query.filter_expr,"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FF98%3D","line":2029,"updated":"2014-01-17 15:12:54.000000000","message":"I\u0027m wondering why visibility_field is parameterized here?\n\ni.e. is there ever a case where it would be set to anything other than \"project_id\"?\n\nIf not, it would more readable to remove this propagated parameter and just hard-code the eventual usage to \"project_id\".","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5348b232a2085b809d2d6e4864b8dbcd8ecab513","unresolved":false,"context_lines":[{"line_number":2026,"context_line":"    @wsme_pecan.wsexpose([Sample], body\u003dComplexQuery)"},{"line_number":2027,"context_line":"    def post(self, body):"},{"line_number":2028,"context_line":"        query \u003d ValidatedComplexQuery(body)"},{"line_number":2029,"context_line":"        query.validate(visibility_field\u003d\"project_id\")"},{"line_number":2030,"context_line":"        conn \u003d pecan.request.storage_conn"},{"line_number":2031,"context_line":"        return [Sample.from_db_model(s)"},{"line_number":2032,"context_line":"                for s in conn.query_samples(query.filter_expr,"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FFng%3D","line":2029,"in_reply_to":"AAAAUH%2F%2FF98%3D","updated":"2014-01-17 18:04:50.000000000","message":"In case of Alarm History, we have \u0027on_behalf_of\u0027, that is why it is not hard coded here.","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"68d619bddc5308d2b9a229d39c37973f6b80b636","unresolved":false,"context_lines":[{"line_number":979,"context_line":"    \"\"\"Holds a sample query encoded in json.\"\"\""},{"line_number":980,"context_line":""},{"line_number":981,"context_line":"    filter \u003d wtypes.text"},{"line_number":982,"context_line":"    \"The filter expression encoded in json\""},{"line_number":983,"context_line":""},{"line_number":984,"context_line":"    orderby \u003d wtypes.text"},{"line_number":985,"context_line":"    (\"The list of single-element dicts of {field name : ASC/DESC}, \" +"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FBjs%3D","line":982,"updated":"2014-01-18 17:13:51.000000000","message":"Forcing the caller to embed JSON in a string is a non-starter for me.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"19afcd57b083ccb7cb9b678db420b386ba581801","unresolved":false,"context_lines":[{"line_number":979,"context_line":"    \"\"\"Holds a sample query encoded in json.\"\"\""},{"line_number":980,"context_line":""},{"line_number":981,"context_line":"    filter \u003d wtypes.text"},{"line_number":982,"context_line":"    \"The filter expression encoded in json\""},{"line_number":983,"context_line":""},{"line_number":984,"context_line":"    orderby \u003d wtypes.text"},{"line_number":985,"context_line":"    (\"The list of single-element dicts of {field name : ASC/DESC}, \" +"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B%2BY4%3D","line":982,"in_reply_to":"AAAAUH%2F%2FBjs%3D","updated":"2014-01-20 10:15:09.000000000","message":"The only reason for embedding the JSON expression into a string that we couldn\u0027t find a way in WSME to get our dynamic and recursive structure accepted.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"68d619bddc5308d2b9a229d39c37973f6b80b636","unresolved":false,"context_lines":[{"line_number":981,"context_line":"    filter \u003d wtypes.text"},{"line_number":982,"context_line":"    \"The filter expression encoded in json\""},{"line_number":983,"context_line":""},{"line_number":984,"context_line":"    orderby \u003d wtypes.text"},{"line_number":985,"context_line":"    (\"The list of single-element dicts of {field name : ASC/DESC}, \" +"},{"line_number":986,"context_line":"     \"specifing the ordering of the result\")"},{"line_number":987,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FBjM%3D","line":984,"updated":"2014-01-18 17:13:51.000000000","message":"orderby is defined as text, but described as a list of pairs. Let\u0027s just define it as a list of the needed pairs.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"19afcd57b083ccb7cb9b678db420b386ba581801","unresolved":false,"context_lines":[{"line_number":981,"context_line":"    filter \u003d wtypes.text"},{"line_number":982,"context_line":"    \"The filter expression encoded in json\""},{"line_number":983,"context_line":""},{"line_number":984,"context_line":"    orderby \u003d wtypes.text"},{"line_number":985,"context_line":"    (\"The list of single-element dicts of {field name : ASC/DESC}, \" +"},{"line_number":986,"context_line":"     \"specifing the ordering of the result\")"},{"line_number":987,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B%2BYY%3D","line":984,"in_reply_to":"AAAAUH%2F%2FBjM%3D","updated":"2014-01-20 10:15:09.000000000","message":"The validation of this field is done by JSONSchema, the structure is [{\"field_name\": \"asc\"}, {\"field_name2\": \"desc\"}, ...]. The reason for this field to be a string is again that we could not find a way to define it for WSME.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"68d619bddc5308d2b9a229d39c37973f6b80b636","unresolved":false,"context_lines":[{"line_number":2042,"context_line":"    event_types \u003d EventTypesController()"},{"line_number":2043,"context_line":"    events \u003d EventsController()"},{"line_number":2044,"context_line":""},{"line_number":2045,"context_line":"    query \u003d QueryController()"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FBjE%3D","line":2045,"updated":"2014-01-18 17:13:51.000000000","message":"Instead of creating an entirely new part of the URL, why not add a method to the SamplesControler? Something like /samples/complex maybe?","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"19afcd57b083ccb7cb9b678db420b386ba581801","unresolved":false,"context_lines":[{"line_number":2042,"context_line":"    event_types \u003d EventTypesController()"},{"line_number":2043,"context_line":"    events \u003d EventsController()"},{"line_number":2044,"context_line":""},{"line_number":2045,"context_line":"    query \u003d QueryController()"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B%2BWE%3D","line":2045,"in_reply_to":"AAAAUH%2F%2FBjE%3D","updated":"2014-01-20 10:15:09.000000000","message":"When we created this new part, the SamplesController did not exist. It also seemed better to keep the parts of the functionality under one umbrella controller, as in the additional patch sets the feature is implemented for Alarm and AlarmChange also. But we can move thess endpoints under the appropriate controllers, if it is a requirement.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"ce99d1a204bc12b1f28e4d6e7657eea748db3324","unresolved":false,"context_lines":[{"line_number":1004,"context_line":""},{"line_number":1005,"context_line":"    @classmethod"},{"line_number":1006,"context_line":"    def sample(cls):"},{"line_number":1007,"context_line":"        return cls(id\u003dstr(uuid.uuid1()),"},{"line_number":1008,"context_line":"                   filter\u003d\u0027{\\\"and\\\": [{\\\"and\\\": [{\\\"\u003d\\\": \u0027 +"},{"line_number":1009,"context_line":"                          \u0027{\\\"counter_name\\\": \\\"cpu_util\\\"}}, \u0027 +"},{"line_number":1010,"context_line":"                          \u0027{\\\"\u003e\\\": {\\\"counter_volume\\\": 0.23}}, \u0027 +"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F9b9I%3D","line":1007,"updated":"2014-02-06 23:28:19.000000000","message":"what\u0027s this id for?","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b11e95f11242787b62244db9ba676b846b42983b","unresolved":false,"context_lines":[{"line_number":1004,"context_line":""},{"line_number":1005,"context_line":"    @classmethod"},{"line_number":1006,"context_line":"    def sample(cls):"},{"line_number":1007,"context_line":"        return cls(id\u003dstr(uuid.uuid1()),"},{"line_number":1008,"context_line":"                   filter\u003d\u0027{\\\"and\\\": [{\\\"and\\\": [{\\\"\u003d\\\": \u0027 +"},{"line_number":1009,"context_line":"                          \u0027{\\\"counter_name\\\": \\\"cpu_util\\\"}}, \u0027 +"},{"line_number":1010,"context_line":"                          \u0027{\\\"\u003e\\\": {\\\"counter_volume\\\": 0.23}}, \u0027 +"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUX%2F%2F4hU%3D","line":1007,"in_reply_to":"AAAAUH%2F9b9I%3D","updated":"2014-02-10 14:47:22.000000000","message":"Good catch, it is not needed here, I removed it.","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"ce99d1a204bc12b1f28e4d6e7657eea748db3324","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"    @classmethod"},{"line_number":1006,"context_line":"    def sample(cls):"},{"line_number":1007,"context_line":"        return cls(id\u003dstr(uuid.uuid1()),"},{"line_number":1008,"context_line":"                   filter\u003d\u0027{\\\"and\\\": [{\\\"and\\\": [{\\\"\u003d\\\": \u0027 +"},{"line_number":1009,"context_line":"                          \u0027{\\\"counter_name\\\": \\\"cpu_util\\\"}}, \u0027 +"},{"line_number":1010,"context_line":"                          \u0027{\\\"\u003e\\\": {\\\"counter_volume\\\": 0.23}}, \u0027 +"},{"line_number":1011,"context_line":"                          \u0027{\\\"\u003c\\\": {\\\"counter_volume\\\": 0.26}}]}, \u0027 +"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F9b8c%3D","line":1008,"updated":"2014-02-06 23:28:19.000000000","message":"you can probably drop the escapes. it doesn\u0027t result in a proper json in docs: http://docs-draft.openstack.org/57/62157/13/check/gate-ceilometer-docs/e7bf10d/doc/build/html/webapi/v2.html#filtering-queries","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b11e95f11242787b62244db9ba676b846b42983b","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"    @classmethod"},{"line_number":1006,"context_line":"    def sample(cls):"},{"line_number":1007,"context_line":"        return cls(id\u003dstr(uuid.uuid1()),"},{"line_number":1008,"context_line":"                   filter\u003d\u0027{\\\"and\\\": [{\\\"and\\\": [{\\\"\u003d\\\": \u0027 +"},{"line_number":1009,"context_line":"                          \u0027{\\\"counter_name\\\": \\\"cpu_util\\\"}}, \u0027 +"},{"line_number":1010,"context_line":"                          \u0027{\\\"\u003e\\\": {\\\"counter_volume\\\": 0.23}}, \u0027 +"},{"line_number":1011,"context_line":"                          \u0027{\\\"\u003c\\\": {\\\"counter_volume\\\": 0.26}}]}, \u0027 +"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUX%2F%2F4fk%3D","line":1008,"in_reply_to":"AAAAUH%2F9b8c%3D","updated":"2014-02-10 14:47:22.000000000","message":"We need the escapes here, as the filter expression has to be string. I think, if I remove the escapes, then I will have to put them back, when someone tries to use the copy of this sample and reports a bug that it does not work.","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"}],"ceilometer/storage/base.py":[{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        :param trait_type: the name of the Trait to filter by"},{"line_number":303,"context_line":"        \"\"\""},{"line_number":304,"context_line":""},{"line_number":305,"context_line":"    @abc.abstractmethod"},{"line_number":306,"context_line":"    def query_samples(self, filter_, orderby\u003d[], limit\u003dNone):"},{"line_number":307,"context_line":"        \"\"\"Return an iterable of model.Sample objects."},{"line_number":308,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2Fxk%3D","line":305,"updated":"2013-12-17 22:57:29.000000000","message":"Those it have to be abstract? Can it just be a normal method that by default raises the not implemented method. That way we avoid duplicate not implemented methods in all implementations.","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"a667839092423af105a300285bac781d2014f21a","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        :param trait_type: the name of the Trait to filter by"},{"line_number":303,"context_line":"        \"\"\""},{"line_number":304,"context_line":""},{"line_number":305,"context_line":"    @abc.abstractmethod"},{"line_number":306,"context_line":"    def query_samples(self, filter_, orderby\u003d[], limit\u003dNone):"},{"line_number":307,"context_line":"        \"\"\"Return an iterable of model.Sample objects."},{"line_number":308,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F84dY%3D","line":305,"in_reply_to":"AAAATn%2F8%2BUI%3D","updated":"2013-12-19 08:17:05.000000000","message":"I changed the method to be staticmethod. I also removed the duplicated code with the NotImplementedErrors from the DB drivers.","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"625c3a346d977908d3b05d34a987fe0bc063ac07","unresolved":false,"context_lines":[{"line_number":302,"context_line":"        :param trait_type: the name of the Trait to filter by"},{"line_number":303,"context_line":"        \"\"\""},{"line_number":304,"context_line":""},{"line_number":305,"context_line":"    @abc.abstractmethod"},{"line_number":306,"context_line":"    def query_samples(self, filter_, orderby\u003d[], limit\u003dNone):"},{"line_number":307,"context_line":"        \"\"\"Return an iterable of model.Sample objects."},{"line_number":308,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2BUI%3D","line":305,"in_reply_to":"AAAATn%2F8%2Fxk%3D","updated":"2013-12-18 08:44:04.000000000","message":"The approach taken heretofore has been to declare the methods abstract on the base driver, then within each of the derived classes, storage.impl_{mongodb|sqlalchemy|db2|...}, we raise NotImplementedError if the functionality is not implemented for that concrete driver.\n\nThat may seem like overly-duplicating the raises code, but IMO it\u0027s a clearer way of signalling the lack of feature parity in certain drivers.","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9760,"name":"koder","email":"koder.mail@gmail.com","username":"Kostiantyn"},"change_message_id":"e1e54e4b6486066b0ca5cfdea35b03e97676b0d0","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        \"\"\""},{"line_number":304,"context_line":""},{"line_number":305,"context_line":"    @abc.abstractmethod"},{"line_number":306,"context_line":"    def query_samples(self, filter_, orderby\u003d[], limit\u003dNone):"},{"line_number":307,"context_line":"        \"\"\"Return an iterable of model.Sample objects."},{"line_number":308,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F83sU%3D","line":306,"updated":"2013-12-19 11:39:25.000000000","message":"\u003e orderby\u003d[]\n\nIt\u0027s better to avoid of using mutable objects as default values, as they would preserve \n changes across function calls. Better use None as default and add\n\nif orderby is None:\n    orderby \u003d []\n\nto beginning of the function","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"68d619bddc5308d2b9a229d39c37973f6b80b636","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        raise NotImplementedError(_(\u0027Events not implemented.\u0027))"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"    @staticmethod"},{"line_number":322,"context_line":"    def query_samples(filter_expr\u003dNone, orderby\u003dNone, limit\u003dNone):"},{"line_number":323,"context_line":"        \"\"\"Return an iterable of model.Sample objects."},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"        :param filter_expr: Filter expression for query."}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FBjA%3D","line":322,"updated":"2014-01-18 17:13:51.000000000","message":"I understand it\u0027s simpler to add a new method to the storage driver for now, but over the longer term we are going to need to consolidate them to keep that API small. One way to do that is to update the old \"simple\" query REST API to convert its inputs to the new format, and then call this method of the storage driver.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"19afcd57b083ccb7cb9b678db420b386ba581801","unresolved":false,"context_lines":[{"line_number":319,"context_line":"        raise NotImplementedError(_(\u0027Events not implemented.\u0027))"},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"    @staticmethod"},{"line_number":322,"context_line":"    def query_samples(filter_expr\u003dNone, orderby\u003dNone, limit\u003dNone):"},{"line_number":323,"context_line":"        \"\"\"Return an iterable of model.Sample objects."},{"line_number":324,"context_line":""},{"line_number":325,"context_line":"        :param filter_expr: Filter expression for query."}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B%2BZY%3D","line":322,"in_reply_to":"AAAAUH%2F%2FBjA%3D","updated":"2014-01-20 10:15:09.000000000","message":"I agree that in long term we should avoid the duplication of the functionality. In case of this feature it seemed to be better to have a separate function in the first step and when we have the final query structure and data processing mechanism, then we can refactor this part of the code. Also we can check during the refactor the test coverage of this part.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"}],"ceilometer/storage/impl_db2.py":[{"author":{"_account_id":9760,"name":"koder","email":"koder.mail@gmail.com","username":"Kostiantyn"},"change_message_id":"e1e54e4b6486066b0ca5cfdea35b03e97676b0d0","unresolved":false,"context_lines":[{"line_number":799,"context_line":""},{"line_number":800,"context_line":"        raise NotImplementedError(_(\u0027Events not implemented.\u0027))"},{"line_number":801,"context_line":""},{"line_number":802,"context_line":"    def query_samples(self, filter_\u003d[], orderby\u003d[], limit\u003dNone):"},{"line_number":803,"context_line":"        \"\"\"Return an iterable of model.Sample objects."},{"line_number":804,"context_line":"        \"\"\""},{"line_number":805,"context_line":"        raise NotImplementedError(\u0027Complex query not implemented.\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F83rY%3D","line":802,"updated":"2013-12-19 11:39:25.000000000","message":"It\u0027s better to avoid of using mutable objects as default values, as they would preserve \n changes across function calls. Better use None as default and add\n\nif orderby is None:\n    orderby \u003d []\n\nto beginning of the function","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":802,"context_line":"    def query_samples(self, filter_\u003d[], orderby\u003d[], limit\u003dNone):"},{"line_number":803,"context_line":"        \"\"\"Return an iterable of model.Sample objects."},{"line_number":804,"context_line":"        \"\"\""},{"line_number":805,"context_line":"        raise NotImplementedError(\u0027Complex query not implemented.\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2F7s%3D","line":805,"updated":"2013-12-17 22:57:29.000000000","message":"_() translation","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"}],"ceilometer/storage/impl_hbase.py":[{"author":{"_account_id":9760,"name":"koder","email":"koder.mail@gmail.com","username":"Kostiantyn"},"change_message_id":"e1e54e4b6486066b0ca5cfdea35b03e97676b0d0","unresolved":false,"context_lines":[{"line_number":687,"context_line":""},{"line_number":688,"context_line":"        raise NotImplementedError(_(\u0027Events not implemented.\u0027))"},{"line_number":689,"context_line":""},{"line_number":690,"context_line":"    def query_samples(self, filter_\u003d[], orderby\u003d[], limit\u003dNone):"},{"line_number":691,"context_line":"        \"\"\"Return an iterable of model.Sample objects."},{"line_number":692,"context_line":"        \"\"\""},{"line_number":693,"context_line":"        raise NotImplementedError(\u0027Complex query not implemented.\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F83rU%3D","line":690,"updated":"2013-12-19 11:39:25.000000000","message":"\u003e orderby\u003d[]\n\nIt\u0027s better to avoid of using mutable objects as default values, as they would preserve \n changes across function calls. Better use None as default and add\n\nif orderby is None:\n    orderby \u003d []\n\nto beginning of the function","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":690,"context_line":"    def query_samples(self, filter_\u003d[], orderby\u003d[], limit\u003dNone):"},{"line_number":691,"context_line":"        \"\"\"Return an iterable of model.Sample objects."},{"line_number":692,"context_line":"        \"\"\""},{"line_number":693,"context_line":"        raise NotImplementedError(\u0027Complex query not implemented.\u0027)"},{"line_number":694,"context_line":""},{"line_number":695,"context_line":""},{"line_number":696,"context_line":"###############"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2F7o%3D","line":693,"updated":"2013-12-17 22:57:29.000000000","message":"_() Translation","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"}],"ceilometer/storage/impl_log.py":[{"author":{"_account_id":9760,"name":"koder","email":"koder.mail@gmail.com","username":"Kostiantyn"},"change_message_id":"e1e54e4b6486066b0ca5cfdea35b03e97676b0d0","unresolved":false,"context_lines":[{"line_number":252,"context_line":""},{"line_number":253,"context_line":"        raise NotImplementedError(_(\u0027Events not implemented.\u0027))"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    def query_samples(self, filter_\u003d[], orderby\u003d[], limit\u003dNone):"},{"line_number":256,"context_line":"        \"\"\"Return an iterable of model.Sample objects."},{"line_number":257,"context_line":"        \"\"\""},{"line_number":258,"context_line":"        raise NotImplementedError(\u0027Complex query not implemented.\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F83rM%3D","line":255,"updated":"2013-12-19 11:39:25.000000000","message":"\u003e orderby\u003d[]\n\nIt\u0027s better to avoid of using mutable objects as default values, as they would preserve \n changes across function calls. Better use None as default and add\n\nif orderby is None:\n    orderby \u003d []\n\nto beginning of the function","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":255,"context_line":"    def query_samples(self, filter_\u003d[], orderby\u003d[], limit\u003dNone):"},{"line_number":256,"context_line":"        \"\"\"Return an iterable of model.Sample objects."},{"line_number":257,"context_line":"        \"\"\""},{"line_number":258,"context_line":"        raise NotImplementedError(\u0027Complex query not implemented.\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2F7g%3D","line":258,"updated":"2013-12-17 22:57:29.000000000","message":"_() translation","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"}],"ceilometer/storage/impl_mongodb.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":741,"context_line":"        query_filter \u003d {}"},{"line_number":742,"context_line":"        orderby_filter \u003d [(\"timestamp\", pymongo.DESCENDING)]"},{"line_number":743,"context_line":"        if limit \u003d\u003d 0:"},{"line_number":744,"context_line":"            return"},{"line_number":745,"context_line":"        if orderby:"},{"line_number":746,"context_line":"            orderby_filter \u003d self._transform_orderby_to_mongo(orderby)"},{"line_number":747,"context_line":"        if filter_:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9IXw%3D","line":744,"updated":"2013-12-16 14:56:30.000000000","message":"For clarity, the check for zero limit should be the first thing done in the method.","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5ca16af4524ff7e14d5a7688848c6cee34695dd4","unresolved":false,"context_lines":[{"line_number":741,"context_line":"        query_filter \u003d {}"},{"line_number":742,"context_line":"        orderby_filter \u003d [(\"timestamp\", pymongo.DESCENDING)]"},{"line_number":743,"context_line":"        if limit \u003d\u003d 0:"},{"line_number":744,"context_line":"            return"},{"line_number":745,"context_line":"        if orderby:"},{"line_number":746,"context_line":"            orderby_filter \u003d self._transform_orderby_to_mongo(orderby)"},{"line_number":747,"context_line":"        if filter_:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9DB4%3D","line":744,"in_reply_to":"AAAATn%2F9IXw%3D","updated":"2013-12-17 14:22:55.000000000","message":"Done","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":765,"context_line":"            s[\u0027counter_unit\u0027] \u003d s.get(\u0027counter_unit\u0027, \u0027\u0027)"},{"line_number":766,"context_line":"            yield models.Sample(**s)"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def _transform_orderby_to_mongo(self, orderby):"},{"line_number":769,"context_line":"        orderby_filter \u003d []"},{"line_number":770,"context_line":"        ordering_functions \u003d {\"ASC\": pymongo.ASCENDING,"},{"line_number":771,"context_line":"                              \"DESC\": pymongo.DESCENDING}"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9IZA%3D","line":768,"updated":"2013-12-16 14:56:30.000000000","message":"@staticmethod?\n\nAlso the \u0027_to_mongo\u0027 suffix is unnecessary in the impl_mongo.py driver (could be considered implicit).","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5ca16af4524ff7e14d5a7688848c6cee34695dd4","unresolved":false,"context_lines":[{"line_number":765,"context_line":"            s[\u0027counter_unit\u0027] \u003d s.get(\u0027counter_unit\u0027, \u0027\u0027)"},{"line_number":766,"context_line":"            yield models.Sample(**s)"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"    def _transform_orderby_to_mongo(self, orderby):"},{"line_number":769,"context_line":"        orderby_filter \u003d []"},{"line_number":770,"context_line":"        ordering_functions \u003d {\"ASC\": pymongo.ASCENDING,"},{"line_number":771,"context_line":"                              \"DESC\": pymongo.DESCENDING}"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9DAk%3D","line":768,"in_reply_to":"AAAATn%2F9IZA%3D","updated":"2013-12-17 14:22:55.000000000","message":"Done","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":776,"context_line":"            orderby_filter.append((field[0], ordering_function))"},{"line_number":777,"context_line":"        return orderby_filter"},{"line_number":778,"context_line":""},{"line_number":779,"context_line":"    def _transform_condition_to_mongo_query(self, condition):"},{"line_number":780,"context_line":"        operators \u003d {\"\u003c\": \"$lt\","},{"line_number":781,"context_line":"                     \"\u003e\": \"$gt\","},{"line_number":782,"context_line":"                     \"\u003c\u003d\": \"$lte\","}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9IY8%3D","line":779,"updated":"2013-12-16 14:56:30.000000000","message":"@staticmethod?\n\nSimilarly for \u0027_to_mongo\u0027 being implicit.","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5ca16af4524ff7e14d5a7688848c6cee34695dd4","unresolved":false,"context_lines":[{"line_number":776,"context_line":"            orderby_filter.append((field[0], ordering_function))"},{"line_number":777,"context_line":"        return orderby_filter"},{"line_number":778,"context_line":""},{"line_number":779,"context_line":"    def _transform_condition_to_mongo_query(self, condition):"},{"line_number":780,"context_line":"        operators \u003d {\"\u003c\": \"$lt\","},{"line_number":781,"context_line":"                     \"\u003e\": \"$gt\","},{"line_number":782,"context_line":"                     \"\u003c\u003d\": \"$lte\","}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9DAY%3D","line":779,"in_reply_to":"AAAATn%2F9IY8%3D","updated":"2013-12-17 14:22:55.000000000","message":"Done","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":804,"context_line":"                elif condition_tree[0] in operators.keys():"},{"line_number":805,"context_line":"                    op[condition_tree[1]] \u003d {}"},{"line_number":806,"context_line":"                    op[condition_tree[1]]["},{"line_number":807,"context_line":"                        operators[condition_tree[0]]] \u003d condition_tree[2]"},{"line_number":808,"context_line":"                    return op"},{"line_number":809,"context_line":""},{"line_number":810,"context_line":"        return process_json_tree(condition)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9IWo%3D","line":807,"updated":"2013-12-16 14:56:30.000000000","message":"My eyes are bleeding ;)\n\nPerhaps slightly clearer as something like:\n\n -    op[condition_tree[1]] \u003d {}\n -    op[condition_tree[1]][\n -        operators[condition_tree[0]]] \u003d condition_tree[2]\n +    operator \u003d operators[condition_tree[0]]\n +    op[condition_tree[1]] \u003d dict(operator\u003dcondition_tree[2])","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5ca16af4524ff7e14d5a7688848c6cee34695dd4","unresolved":false,"context_lines":[{"line_number":804,"context_line":"                elif condition_tree[0] in operators.keys():"},{"line_number":805,"context_line":"                    op[condition_tree[1]] \u003d {}"},{"line_number":806,"context_line":"                    op[condition_tree[1]]["},{"line_number":807,"context_line":"                        operators[condition_tree[0]]] \u003d condition_tree[2]"},{"line_number":808,"context_line":"                    return op"},{"line_number":809,"context_line":""},{"line_number":810,"context_line":"        return process_json_tree(condition)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9C%2B8%3D","line":807,"in_reply_to":"AAAATn%2F9Dhc%3D","updated":"2013-12-17 14:22:55.000000000","message":"Done","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"823b1d29172d19bb4dac77f5d3df7f780f716b38","unresolved":false,"context_lines":[{"line_number":804,"context_line":"                elif condition_tree[0] in operators.keys():"},{"line_number":805,"context_line":"                    op[condition_tree[1]] \u003d {}"},{"line_number":806,"context_line":"                    op[condition_tree[1]]["},{"line_number":807,"context_line":"                        operators[condition_tree[0]]] \u003d condition_tree[2]"},{"line_number":808,"context_line":"                    return op"},{"line_number":809,"context_line":""},{"line_number":810,"context_line":"        return process_json_tree(condition)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9Dhc%3D","line":807,"in_reply_to":"AAAATn%2F9FPo%3D","updated":"2013-12-17 08:40:56.000000000","message":"Yes, you\u0027re absolutely right ... I was just being lazy when typing up the comment, so used the shorthand dict style.","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"801cfc52c0ea2a5e74cd1d2c38b9d825f519285f","unresolved":false,"context_lines":[{"line_number":804,"context_line":"                elif condition_tree[0] in operators.keys():"},{"line_number":805,"context_line":"                    op[condition_tree[1]] \u003d {}"},{"line_number":806,"context_line":"                    op[condition_tree[1]]["},{"line_number":807,"context_line":"                        operators[condition_tree[0]]] \u003d condition_tree[2]"},{"line_number":808,"context_line":"                    return op"},{"line_number":809,"context_line":""},{"line_number":810,"context_line":"        return process_json_tree(condition)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9FPo%3D","line":807,"in_reply_to":"AAAATn%2F9IWo%3D","updated":"2013-12-16 23:38:05.000000000","message":"I think the dict(operator\u003dcondition_tree[2]) won\u0027t create the dict with a proper key as the key will be always \"operator\" as a string\n\nWhat do you think about the following expression instead?\n\noperator \u003d operators[condition_tree[0]]\nop \u003d {\n    condition_tree[1]: {\n        operator: condition_tree[2]\n    }\n}","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9760,"name":"koder","email":"koder.mail@gmail.com","username":"Kostiantyn"},"change_message_id":"e1e54e4b6486066b0ca5cfdea35b03e97676b0d0","unresolved":false,"context_lines":[{"line_number":737,"context_line":"            s[\u0027counter_unit\u0027] \u003d s.get(\u0027counter_unit\u0027, \u0027\u0027)"},{"line_number":738,"context_line":"            yield models.Sample(**s)"},{"line_number":739,"context_line":""},{"line_number":740,"context_line":"    def query_samples(self, filter_\u003d[], orderby\u003d[], limit\u003dNone):"},{"line_number":741,"context_line":"        if limit \u003d\u003d 0:"},{"line_number":742,"context_line":"            return"},{"line_number":743,"context_line":"        query_filter \u003d {}"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F83rI%3D","line":740,"updated":"2013-12-19 11:39:25.000000000","message":"\u003e orderby\u003d[]\n\nIt\u0027s better to avoid of using mutable objects as default values, as they would preserve \n changes across function calls. Better use None as default and add\n\nif orderby is None:\n    orderby \u003d []\n\nto beginning of the function","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9760,"name":"koder","email":"koder.mail@gmail.com","username":"Kostiantyn"},"change_message_id":"e1e54e4b6486066b0ca5cfdea35b03e97676b0d0","unresolved":false,"context_lines":[{"line_number":748,"context_line":"            query_filter \u003d self._transform_filter("},{"line_number":749,"context_line":"                filter_)"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        if limit:"},{"line_number":752,"context_line":"            samples \u003d self.db.meter.find(query_filter,"},{"line_number":753,"context_line":"                                         limit\u003dlimit,"},{"line_number":754,"context_line":"                                         sort\u003dorderby_filter)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F83qw%3D","line":751,"updated":"2013-12-19 11:39:25.000000000","message":"use explicit \u0027is None\u0027 check\n\nif limit is None:","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9760,"name":"koder","email":"koder.mail@gmail.com","username":"Kostiantyn"},"change_message_id":"e1e54e4b6486066b0ca5cfdea35b03e97676b0d0","unresolved":false,"context_lines":[{"line_number":772,"context_line":"                              \"desc\": pymongo.DESCENDING}"},{"line_number":773,"context_line":"        for field in orderby:"},{"line_number":774,"context_line":"            ordering_function \u003d pymongo.DESCENDING"},{"line_number":775,"context_line":"            if orderby:"},{"line_number":776,"context_line":"                ordering_function \u003d ordering_functions[field[1]]"},{"line_number":777,"context_line":"            orderby_filter.append((field[0], ordering_function))"},{"line_number":778,"context_line":"        return orderby_filter"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F83o0%3D","line":775,"updated":"2013-12-19 11:39:25.000000000","message":"if \u0027orderby\u0027 is avaluated to False code would never reach this line, as we do\n\nfor field in orderby two lines above","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9760,"name":"koder","email":"koder.mail@gmail.com","username":"Kostiantyn"},"change_message_id":"e1e54e4b6486066b0ca5cfdea35b03e97676b0d0","unresolved":false,"context_lines":[{"line_number":789,"context_line":"        complex_operators \u003d {\"or\": \"$or\","},{"line_number":790,"context_line":"                             \"and\": \"$and\"}"},{"line_number":791,"context_line":""},{"line_number":792,"context_line":"        def process_json_tree(condition_tree):"},{"line_number":793,"context_line":"            op \u003d {}"},{"line_number":794,"context_line":"            if condition_tree[0] in complex_operators.keys():"},{"line_number":795,"context_line":"                #recurse"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F83pM%3D","line":792,"updated":"2013-12-19 11:39:25.000000000","message":"you can create aliases for \ncondition_tree[0], condition_tree[1], condition_tree[2]","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9760,"name":"koder","email":"koder.mail@gmail.com","username":"Kostiantyn"},"change_message_id":"e1e54e4b6486066b0ca5cfdea35b03e97676b0d0","unresolved":false,"context_lines":[{"line_number":791,"context_line":""},{"line_number":792,"context_line":"        def process_json_tree(condition_tree):"},{"line_number":793,"context_line":"            op \u003d {}"},{"line_number":794,"context_line":"            if condition_tree[0] in complex_operators.keys():"},{"line_number":795,"context_line":"                #recurse"},{"line_number":796,"context_line":"                left \u003d process_json_tree(condition_tree[1])"},{"line_number":797,"context_line":"                right \u003d process_json_tree(condition_tree[2])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F83qI%3D","line":794,"updated":"2013-12-19 11:39:25.000000000","message":"\u0027in\u0027 work on dictionary keys by default\n\nif condition_tree[0] in complex_operators.keys():\n\nis equals to\n\nif condition_tree[0] in complex_operators:","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9760,"name":"koder","email":"koder.mail@gmail.com","username":"Kostiantyn"},"change_message_id":"e1e54e4b6486066b0ca5cfdea35b03e97676b0d0","unresolved":false,"context_lines":[{"line_number":803,"context_line":"                    op[condition_tree[1]] \u003d condition_tree[2]"},{"line_number":804,"context_line":"                    return op"},{"line_number":805,"context_line":"                #at leaf"},{"line_number":806,"context_line":"                elif condition_tree[0] in operators.keys():"},{"line_number":807,"context_line":"                    operator \u003d operators[condition_tree[0]]"},{"line_number":808,"context_line":"                    op \u003d {"},{"line_number":809,"context_line":"                        condition_tree[1]: {"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F83pg%3D","line":806,"updated":"2013-12-19 11:39:25.000000000","message":"same as above, just\n\n\ncondition_tree[0] in operators","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4fda48b40bb924f9a8c14e8a3aa3fe506a9a5010","unresolved":false,"context_lines":[{"line_number":739,"context_line":""},{"line_number":740,"context_line":"    def query_samples(self, filter_expr\u003dNone, orderby\u003dNone, limit\u003dNone):"},{"line_number":741,"context_line":"        if limit \u003d\u003d 0:"},{"line_number":742,"context_line":"            return"},{"line_number":743,"context_line":"        query_filter \u003d {}"},{"line_number":744,"context_line":"        orderby_filter \u003d [(\"timestamp\", pymongo.DESCENDING)]"},{"line_number":745,"context_line":"        if orderby is not None:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F638%3D","line":742,"updated":"2014-01-06 19:32:30.000000000","message":"Is there a test for this? (likewise in sqlalchemy)","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"8b6b8c8e049c5f3ef7063b0f567d69ca9cdea7a2","unresolved":false,"context_lines":[{"line_number":739,"context_line":""},{"line_number":740,"context_line":"    def query_samples(self, filter_expr\u003dNone, orderby\u003dNone, limit\u003dNone):"},{"line_number":741,"context_line":"        if limit \u003d\u003d 0:"},{"line_number":742,"context_line":"            return"},{"line_number":743,"context_line":"        query_filter \u003d {}"},{"line_number":744,"context_line":"        orderby_filter \u003d [(\"timestamp\", pymongo.DESCENDING)]"},{"line_number":745,"context_line":"        if orderby is not None:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F3js%3D","line":742,"in_reply_to":"AAAAUH%2F%2F4oA%3D","updated":"2014-01-07 13:17:08.000000000","message":"Thanks ... missed that one.","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"7232b10cb3195b100a06391d8d664add50a2a797","unresolved":false,"context_lines":[{"line_number":739,"context_line":""},{"line_number":740,"context_line":"    def query_samples(self, filter_expr\u003dNone, orderby\u003dNone, limit\u003dNone):"},{"line_number":741,"context_line":"        if limit \u003d\u003d 0:"},{"line_number":742,"context_line":"            return"},{"line_number":743,"context_line":"        query_filter \u003d {}"},{"line_number":744,"context_line":"        orderby_filter \u003d [(\"timestamp\", pymongo.DESCENDING)]"},{"line_number":745,"context_line":"        if orderby is not None:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F4oA%3D","line":742,"in_reply_to":"AAAAUH%2F%2F638%3D","updated":"2014-01-07 08:47:52.000000000","message":"We have a testcase, called test_no_filter_with_zero_limit, here: https://review.openstack.org/#/c/62157/5/ceilometer/tests/storage/test_storage_scenarios.py","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4fda48b40bb924f9a8c14e8a3aa3fe506a9a5010","unresolved":false,"context_lines":[{"line_number":796,"context_line":"                complex_operator \u003d complex_operators[operator_node]"},{"line_number":797,"context_line":"                op \u003d {complex_operator: [left, right]}"},{"line_number":798,"context_line":"                return op"},{"line_number":799,"context_line":"            else:"},{"line_number":800,"context_line":"                #no operator for equal in Mongo"},{"line_number":801,"context_line":"                if operator_node \u003d\u003d \"\u003d\":"},{"line_number":802,"context_line":"                    op \u003d {left_node: right_node}"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F65A%3D","line":799,"updated":"2014-01-06 19:32:30.000000000","message":"Don\u0027t need else:, so we can unindent","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"f0145cdc1ec8cd6ff4537fa7702094efa9c35fcb","unresolved":false,"context_lines":[{"line_number":796,"context_line":"                complex_operator \u003d complex_operators[operator_node]"},{"line_number":797,"context_line":"                op \u003d {complex_operator: [left, right]}"},{"line_number":798,"context_line":"                return op"},{"line_number":799,"context_line":"            else:"},{"line_number":800,"context_line":"                #no operator for equal in Mongo"},{"line_number":801,"context_line":"                if operator_node \u003d\u003d \"\u003d\":"},{"line_number":802,"context_line":"                    op \u003d {left_node: right_node}"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F3gk%3D","line":799,"in_reply_to":"AAAAUH%2F%2F65A%3D","updated":"2014-01-07 13:33:44.000000000","message":"Done","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4fda48b40bb924f9a8c14e8a3aa3fe506a9a5010","unresolved":false,"context_lines":[{"line_number":797,"context_line":"                op \u003d {complex_operator: [left, right]}"},{"line_number":798,"context_line":"                return op"},{"line_number":799,"context_line":"            else:"},{"line_number":800,"context_line":"                #no operator for equal in Mongo"},{"line_number":801,"context_line":"                if operator_node \u003d\u003d \"\u003d\":"},{"line_number":802,"context_line":"                    op \u003d {left_node: right_node}"},{"line_number":803,"context_line":"                    return op"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F640%3D","line":800,"updated":"2014-01-06 19:32:30.000000000","message":"Space after #","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"f0145cdc1ec8cd6ff4537fa7702094efa9c35fcb","unresolved":false,"context_lines":[{"line_number":797,"context_line":"                op \u003d {complex_operator: [left, right]}"},{"line_number":798,"context_line":"                return op"},{"line_number":799,"context_line":"            else:"},{"line_number":800,"context_line":"                #no operator for equal in Mongo"},{"line_number":801,"context_line":"                if operator_node \u003d\u003d \"\u003d\":"},{"line_number":802,"context_line":"                    op \u003d {left_node: right_node}"},{"line_number":803,"context_line":"                    return op"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F3gg%3D","line":800,"in_reply_to":"AAAAUH%2F%2F640%3D","updated":"2014-01-07 13:33:44.000000000","message":"Done","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4fda48b40bb924f9a8c14e8a3aa3fe506a9a5010","unresolved":false,"context_lines":[{"line_number":801,"context_line":"                if operator_node \u003d\u003d \"\u003d\":"},{"line_number":802,"context_line":"                    op \u003d {left_node: right_node}"},{"line_number":803,"context_line":"                    return op"},{"line_number":804,"context_line":"                elif operator_node in operators:"},{"line_number":805,"context_line":"                    operator \u003d operators[operator_node]"},{"line_number":806,"context_line":"                    op \u003d {"},{"line_number":807,"context_line":"                        left_node: {"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F648%3D","line":804,"updated":"2014-01-06 19:32:30.000000000","message":"likewise here.","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"f0145cdc1ec8cd6ff4537fa7702094efa9c35fcb","unresolved":false,"context_lines":[{"line_number":801,"context_line":"                if operator_node \u003d\u003d \"\u003d\":"},{"line_number":802,"context_line":"                    op \u003d {left_node: right_node}"},{"line_number":803,"context_line":"                    return op"},{"line_number":804,"context_line":"                elif operator_node in operators:"},{"line_number":805,"context_line":"                    operator \u003d operators[operator_node]"},{"line_number":806,"context_line":"                    op \u003d {"},{"line_number":807,"context_line":"                        left_node: {"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F3gc%3D","line":804,"in_reply_to":"AAAAUH%2F%2F648%3D","updated":"2014-01-07 13:33:44.000000000","message":"Done","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"99e43ddca6a52472e72325df7aee673068b04610","unresolved":false,"context_lines":[{"line_number":752,"context_line":"            del s[\u0027_id\u0027]"},{"line_number":753,"context_line":"            # Backward compatibility for samples without units"},{"line_number":754,"context_line":"            s[\u0027counter_unit\u0027] \u003d s.get(\u0027counter_unit\u0027, \u0027\u0027)"},{"line_number":755,"context_line":"            yield models.Sample(**s)"},{"line_number":756,"context_line":""},{"line_number":757,"context_line":"    @staticmethod"},{"line_number":758,"context_line":"    def _transform_orderby(orderby):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FFw0%3D","line":755,"updated":"2014-01-17 15:12:54.000000000","message":"Lines 740-755 are pretty much a copy\u0027n\u0027paste of lines 714-728.\n\nCan these be simply factored out to helper method with the query and sort parameterized?","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5348b232a2085b809d2d6e4864b8dbcd8ecab513","unresolved":false,"context_lines":[{"line_number":752,"context_line":"            del s[\u0027_id\u0027]"},{"line_number":753,"context_line":"            # Backward compatibility for samples without units"},{"line_number":754,"context_line":"            s[\u0027counter_unit\u0027] \u003d s.get(\u0027counter_unit\u0027, \u0027\u0027)"},{"line_number":755,"context_line":"            yield models.Sample(**s)"},{"line_number":756,"context_line":""},{"line_number":757,"context_line":"    @staticmethod"},{"line_number":758,"context_line":"    def _transform_orderby(orderby):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FEmQ%3D","line":755,"in_reply_to":"AAAAUH%2F%2FFw0%3D","updated":"2014-01-17 18:04:50.000000000","message":"Done","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"68d619bddc5308d2b9a229d39c37973f6b80b636","unresolved":false,"context_lines":[{"line_number":732,"context_line":"                    user_id\u003dr[\u0027user_id\u0027],"},{"line_number":733,"context_line":"                )"},{"line_number":734,"context_line":""},{"line_number":735,"context_line":"    def retrieve_samples(self, query, orderby, limit):"},{"line_number":736,"context_line":"        if limit is not None:"},{"line_number":737,"context_line":"            samples \u003d self.db.meter.find(query,"},{"line_number":738,"context_line":"                                         limit\u003dlimit,"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FBi0%3D","line":735,"updated":"2014-01-18 17:13:51.000000000","message":"The base class for the drivers does not seem to include this new method. Should this be a private method?","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"19afcd57b083ccb7cb9b678db420b386ba581801","unresolved":false,"context_lines":[{"line_number":732,"context_line":"                    user_id\u003dr[\u0027user_id\u0027],"},{"line_number":733,"context_line":"                )"},{"line_number":734,"context_line":""},{"line_number":735,"context_line":"    def retrieve_samples(self, query, orderby, limit):"},{"line_number":736,"context_line":"        if limit is not None:"},{"line_number":737,"context_line":"            samples \u003d self.db.meter.find(query,"},{"line_number":738,"context_line":"                                         limit\u003dlimit,"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B%2Bak%3D","line":735,"in_reply_to":"AAAAUH%2F%2FBi0%3D","updated":"2014-01-20 10:15:09.000000000","message":"This function was changed to be private.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"68d619bddc5308d2b9a229d39c37973f6b80b636","unresolved":false,"context_lines":[{"line_number":750,"context_line":"            s[\u0027counter_unit\u0027] \u003d s.get(\u0027counter_unit\u0027, \u0027\u0027)"},{"line_number":751,"context_line":"            yield models.Sample(**s)"},{"line_number":752,"context_line":""},{"line_number":753,"context_line":"    def get_samples(self, sample_filter, limit\u003dNone):"},{"line_number":754,"context_line":"        \"\"\"Return an iterable of model.Sample instances."},{"line_number":755,"context_line":""},{"line_number":756,"context_line":"        :param sample_filter: Filter."}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FBiw%3D","line":753,"updated":"2014-01-18 17:13:51.000000000","message":"The base class for the drivers does not seem to include this new method. Should this be a private method?\n\nThe 3 names retrieve_samples, get_samples, and query_samples are not sufficiently different to all be public methods, so if they do all need to be public they need more descriptive names.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"19afcd57b083ccb7cb9b678db420b386ba581801","unresolved":false,"context_lines":[{"line_number":750,"context_line":"            s[\u0027counter_unit\u0027] \u003d s.get(\u0027counter_unit\u0027, \u0027\u0027)"},{"line_number":751,"context_line":"            yield models.Sample(**s)"},{"line_number":752,"context_line":""},{"line_number":753,"context_line":"    def get_samples(self, sample_filter, limit\u003dNone):"},{"line_number":754,"context_line":"        \"\"\"Return an iterable of model.Sample instances."},{"line_number":755,"context_line":""},{"line_number":756,"context_line":"        :param sample_filter: Filter."}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B%2Bao%3D","line":753,"in_reply_to":"AAAAUH%2F%2FBiw%3D","updated":"2014-01-20 10:15:09.000000000","message":"The get_samples is the original funcion for retrieve samples from th DBs. The query_samples belongs to the complex query feature. The retrieve_samples was changed to be private, this function was needed to avoid code duplication.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"}],"ceilometer/storage/impl_sqlalchemy.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":608,"context_line":"                message_signature\u003ds.message_signature,"},{"line_number":609,"context_line":"            )"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"    def _transform_to_sqlalchemy(self, expression_tree, table):"},{"line_number":612,"context_line":""},{"line_number":613,"context_line":"        operators \u003d {\"\u003d\": operator.eq,"},{"line_number":614,"context_line":"                     \"\u003c\": operator.lt,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9IVs%3D","line":611,"updated":"2013-12-16 14:56:30.000000000","message":"The \u0027_to_sqlalchemy\u0027 suffix is unnecessary in the impl_sqlalchemy.py driver (could be considered implicit).","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5ca16af4524ff7e14d5a7688848c6cee34695dd4","unresolved":false,"context_lines":[{"line_number":608,"context_line":"                message_signature\u003ds.message_signature,"},{"line_number":609,"context_line":"            )"},{"line_number":610,"context_line":""},{"line_number":611,"context_line":"    def _transform_to_sqlalchemy(self, expression_tree, table):"},{"line_number":612,"context_line":""},{"line_number":613,"context_line":"        operators \u003d {\"\u003d\": operator.eq,"},{"line_number":614,"context_line":"                     \"\u003c\": operator.lt,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9C%2BE%3D","line":611,"in_reply_to":"AAAATn%2F9IVs%3D","updated":"2013-12-17 14:22:55.000000000","message":"Done","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9760,"name":"koder","email":"koder.mail@gmail.com","username":"Kostiantyn"},"change_message_id":"e1e54e4b6486066b0ca5cfdea35b03e97676b0d0","unresolved":false,"context_lines":[{"line_number":567,"context_line":"                message_signature\u003ds.message_signature,"},{"line_number":568,"context_line":"            )"},{"line_number":569,"context_line":""},{"line_number":570,"context_line":"    def query_samples(self, filter_\u003d[], orderby\u003d[], limit\u003dNone):"},{"line_number":571,"context_line":"        if limit \u003d\u003d 0:"},{"line_number":572,"context_line":"            return"},{"line_number":573,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F83nM%3D","line":570,"updated":"2013-12-19 11:39:25.000000000","message":"same as in other files, try to avoid using [] as default value, use None instead","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9760,"name":"koder","email":"koder.mail@gmail.com","username":"Kostiantyn"},"change_message_id":"e1e54e4b6486066b0ca5cfdea35b03e97676b0d0","unresolved":false,"context_lines":[{"line_number":622,"context_line":"                             \"and\": and_}"},{"line_number":623,"context_line":""},{"line_number":624,"context_line":"        def transform(sub_tree):"},{"line_number":625,"context_line":"            if sub_tree[0] in complex_operators.keys():"},{"line_number":626,"context_line":"                #recurse"},{"line_number":627,"context_line":"                op \u003d complex_operators[sub_tree[0]]"},{"line_number":628,"context_line":"                left \u003d transform(sub_tree[1])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F83nY%3D","line":625,"updated":"2013-12-19 11:39:25.000000000","message":"if sub_tree[0] in complex_operators","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":638,"context_line":"    def _apply_order_by(self, query, orderby, table):"},{"line_number":639,"context_line":"        ordering_functions \u003d {\"asc\": asc,"},{"line_number":640,"context_line":"                              \"desc\": desc}"},{"line_number":641,"context_line":"        query \u003d query.from_self()"},{"line_number":642,"context_line":"        if orderby:"},{"line_number":643,"context_line":"            for field in orderby:"},{"line_number":644,"context_line":"                    ordering_function \u003d ordering_functions[field[1]]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2Fm0%3D","line":641,"updated":"2013-12-17 22:57:29.000000000","message":"Try to avoid the copy","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"a667839092423af105a300285bac781d2014f21a","unresolved":false,"context_lines":[{"line_number":638,"context_line":"    def _apply_order_by(self, query, orderby, table):"},{"line_number":639,"context_line":"        ordering_functions \u003d {\"asc\": asc,"},{"line_number":640,"context_line":"                              \"desc\": desc}"},{"line_number":641,"context_line":"        query \u003d query.from_self()"},{"line_number":642,"context_line":"        if orderby:"},{"line_number":643,"context_line":"            for field in orderby:"},{"line_number":644,"context_line":"                    ordering_function \u003d ordering_functions[field[1]]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F84es%3D","line":641,"in_reply_to":"AAAATn%2F8%2Fm0%3D","updated":"2013-12-19 08:17:05.000000000","message":"Done","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":645,"context_line":"                    query \u003d query.order_by(ordering_function("},{"line_number":646,"context_line":"                        getattr(table, field[0])))"},{"line_number":647,"context_line":"        else:"},{"line_number":648,"context_line":"            query \u003d query.order_by(desc(table.timestamp))"},{"line_number":649,"context_line":"        return query"},{"line_number":650,"context_line":""},{"line_number":651,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2Fms%3D","line":648,"updated":"2013-12-17 22:57:29.000000000","message":"try to avoid the copy","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"297d6cf1dcb794edb8649af5132bec41beed1537","unresolved":false,"context_lines":[{"line_number":645,"context_line":"                    query \u003d query.order_by(ordering_function("},{"line_number":646,"context_line":"                        getattr(table, field[0])))"},{"line_number":647,"context_line":"        else:"},{"line_number":648,"context_line":"            query \u003d query.order_by(desc(table.timestamp))"},{"line_number":649,"context_line":"        return query"},{"line_number":650,"context_line":""},{"line_number":651,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8620%3D","line":648,"in_reply_to":"AAAATn%2F8%2Fms%3D","updated":"2013-12-18 19:43:34.000000000","message":"This is how SqlAlchemy gives a possibility to specify the orderby clause of the query. Btw the whole SqlAlchemy API is designed in the similar way following the Builder design pattern.","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":646,"context_line":"                        getattr(table, field[0])))"},{"line_number":647,"context_line":"        else:"},{"line_number":648,"context_line":"            query \u003d query.order_by(desc(table.timestamp))"},{"line_number":649,"context_line":"        return query"},{"line_number":650,"context_line":""},{"line_number":651,"context_line":"    @staticmethod"},{"line_number":652,"context_line":"    def _make_stats_query(sample_filter, groupby):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2Fmo%3D","line":649,"updated":"2013-12-17 22:57:29.000000000","message":"try to make query mutable so that you don\u0027t have to return","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"297d6cf1dcb794edb8649af5132bec41beed1537","unresolved":false,"context_lines":[{"line_number":646,"context_line":"                        getattr(table, field[0])))"},{"line_number":647,"context_line":"        else:"},{"line_number":648,"context_line":"            query \u003d query.order_by(desc(table.timestamp))"},{"line_number":649,"context_line":"        return query"},{"line_number":650,"context_line":""},{"line_number":651,"context_line":"    @staticmethod"},{"line_number":652,"context_line":"    def _make_stats_query(sample_filter, groupby):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F862w%3D","line":649,"in_reply_to":"AAAATn%2F8%2Fmo%3D","updated":"2013-12-18 19:43:34.000000000","message":"It is again a reference passing so I don\u0027t see the reason why we have to avoid the return. You can see another example of this style in couple of places for example in make_query_from_filter","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"a1a7d9fb70c0071c1e7f427f768cedd87f490b20","unresolved":false,"context_lines":[{"line_number":646,"context_line":"                        getattr(table, field[0])))"},{"line_number":647,"context_line":"        else:"},{"line_number":648,"context_line":"            query \u003d query.order_by(desc(table.timestamp))"},{"line_number":649,"context_line":"        return query"},{"line_number":650,"context_line":""},{"line_number":651,"context_line":"    @staticmethod"},{"line_number":652,"context_line":"    def _make_stats_query(sample_filter, groupby):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2Fwfw%3D","line":649,"in_reply_to":"AAAATn%2F862w%3D","updated":"2014-01-08 19:59:06.000000000","message":"you are returning a reference to and object that was passed. If it is all handled as a reference there is no need to return","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4fda48b40bb924f9a8c14e8a3aa3fe506a9a5010","unresolved":false,"context_lines":[{"line_number":24,"context_line":"import os"},{"line_number":25,"context_line":"import types"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from sqlalchemy import and_, or_"},{"line_number":28,"context_line":"from sqlalchemy import asc"},{"line_number":29,"context_line":"from sqlalchemy import desc"},{"line_number":30,"context_line":"from sqlalchemy import func"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F63s%3D","line":27,"updated":"2014-01-06 19:32:30.000000000","message":"alphabetic ordering","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"f0145cdc1ec8cd6ff4537fa7702094efa9c35fcb","unresolved":false,"context_lines":[{"line_number":24,"context_line":"import os"},{"line_number":25,"context_line":"import types"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from sqlalchemy import and_, or_"},{"line_number":28,"context_line":"from sqlalchemy import asc"},{"line_number":29,"context_line":"from sqlalchemy import desc"},{"line_number":30,"context_line":"from sqlalchemy import func"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2F3gU%3D","line":27,"in_reply_to":"AAAAUH%2F%2F63s%3D","updated":"2014-01-07 13:33:44.000000000","message":"Done","commit_id":"e468c55162030e0c772359deb085470acc84724c"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"b76709b99f787534211c65494e9dce22eb70eec0","unresolved":false,"context_lines":[{"line_number":599,"context_line":"                                                       models.Meter)"},{"line_number":600,"context_line":"            query \u003d query.filter(sql_condition)"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"        query \u003d self._apply_order_by(query, orderby, models.Meter)"},{"line_number":603,"context_line":""},{"line_number":604,"context_line":"        if limit is not None:"},{"line_number":605,"context_line":"            query \u003d query.limit(limit)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2FwcM%3D","line":602,"updated":"2014-01-08 20:16:42.000000000","message":"Still think this will be cleaner is you don\u0027t return query. Just call self._apply_order_by(query, orderby, models.Meter) without assigning return value to query again. Did query var changed as you wanted. Not sure if query is a mutable par. If it is there is not need to return on that function","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"334abb66f01d03f2659cc0de533765d92c175fa6","unresolved":false,"context_lines":[{"line_number":599,"context_line":"                                                       models.Meter)"},{"line_number":600,"context_line":"            query \u003d query.filter(sql_condition)"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"        query \u003d self._apply_order_by(query, orderby, models.Meter)"},{"line_number":603,"context_line":""},{"line_number":604,"context_line":"        if limit is not None:"},{"line_number":605,"context_line":"            query \u003d query.limit(limit)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2FluQ%3D","line":602,"in_reply_to":"AAAAUH%2F%2FwcM%3D","updated":"2014-01-10 18:17:01.000000000","message":"Query is implemented by SQLAlchemy and the functions that operate on query return with a new object instead of modifying the parameter.","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"99e43ddca6a52472e72325df7aee673068b04610","unresolved":false,"context_lines":[{"line_number":618,"context_line":"                resource_metadata\u003ds.resource_metadata,"},{"line_number":619,"context_line":"                message_id\u003ds.message_id,"},{"line_number":620,"context_line":"                message_signature\u003ds.message_signature,"},{"line_number":621,"context_line":"            )"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":"    def _transform_expression(self, expression_tree, table):"},{"line_number":624,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FFvo%3D","line":621,"updated":"2014-01-17 15:12:54.000000000","message":"Again, there\u0027s a fair amount of copy\u0027n\u0027paste in lines 596-621 - can this be factored out into a parameterized helper method?","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5348b232a2085b809d2d6e4864b8dbcd8ecab513","unresolved":false,"context_lines":[{"line_number":618,"context_line":"                resource_metadata\u003ds.resource_metadata,"},{"line_number":619,"context_line":"                message_id\u003ds.message_id,"},{"line_number":620,"context_line":"                message_signature\u003ds.message_signature,"},{"line_number":621,"context_line":"            )"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":"    def _transform_expression(self, expression_tree, table):"},{"line_number":624,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2FEmI%3D","line":621,"in_reply_to":"AAAAUH%2F%2FFvo%3D","updated":"2014-01-17 18:04:50.000000000","message":"Done","commit_id":"73856283c4a2f4205ec64ffae849d3fac38974a9"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"68d619bddc5308d2b9a229d39c37973f6b80b636","unresolved":false,"context_lines":[{"line_number":538,"context_line":"                source\u003dresource.sources[0].id,"},{"line_number":539,"context_line":"                user_id\u003dresource.user_id)"},{"line_number":540,"context_line":""},{"line_number":541,"context_line":"    def retrieve_samples(self, query, orderby, limit, table):"},{"line_number":542,"context_line":"        query \u003d self._apply_order_by(query, orderby, table)"},{"line_number":543,"context_line":"        if limit is not None:"},{"line_number":544,"context_line":"            query \u003d query.limit(limit)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FBis%3D","line":541,"updated":"2014-01-18 17:13:51.000000000","message":"The base class for the drivers does not seem to include this new method. Should this be a private method?","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"19afcd57b083ccb7cb9b678db420b386ba581801","unresolved":false,"context_lines":[{"line_number":538,"context_line":"                source\u003dresource.sources[0].id,"},{"line_number":539,"context_line":"                user_id\u003dresource.user_id)"},{"line_number":540,"context_line":""},{"line_number":541,"context_line":"    def retrieve_samples(self, query, orderby, limit, table):"},{"line_number":542,"context_line":"        query \u003d self._apply_order_by(query, orderby, table)"},{"line_number":543,"context_line":"        if limit is not None:"},{"line_number":544,"context_line":"            query \u003d query.limit(limit)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B%2Bcc%3D","line":541,"in_reply_to":"AAAAUH%2F%2FBis%3D","updated":"2014-01-20 10:15:09.000000000","message":"Changed to private method.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"68d619bddc5308d2b9a229d39c37973f6b80b636","unresolved":false,"context_lines":[{"line_number":566,"context_line":"                message_signature\u003ds.message_signature,"},{"line_number":567,"context_line":"            )"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"    def get_samples(self, sample_filter, limit\u003dNone):"},{"line_number":570,"context_line":"        \"\"\"Return an iterable of api_models.Samples."},{"line_number":571,"context_line":""},{"line_number":572,"context_line":"        :param sample_filter: Filter."}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FBio%3D","line":569,"updated":"2014-01-18 17:13:51.000000000","message":"The base class for the drivers does not seem to include this new method. Should this be a private method?","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"19afcd57b083ccb7cb9b678db420b386ba581801","unresolved":false,"context_lines":[{"line_number":566,"context_line":"                message_signature\u003ds.message_signature,"},{"line_number":567,"context_line":"            )"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"    def get_samples(self, sample_filter, limit\u003dNone):"},{"line_number":570,"context_line":"        \"\"\"Return an iterable of api_models.Samples."},{"line_number":571,"context_line":""},{"line_number":572,"context_line":"        :param sample_filter: Filter."}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B%2Bbw%3D","line":569,"in_reply_to":"AAAAUH%2F%2FBio%3D","updated":"2014-01-20 10:15:09.000000000","message":"It is the original get_samples function, it was changed a bit to avoid code duplication and it is showed to be new only in the diff.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"68d619bddc5308d2b9a229d39c37973f6b80b636","unresolved":false,"context_lines":[{"line_number":600,"context_line":""},{"line_number":601,"context_line":"    def _transform_expression(self, expression_tree, table):"},{"line_number":602,"context_line":""},{"line_number":603,"context_line":"        operators \u003d {\"\u003d\": operator.eq,"},{"line_number":604,"context_line":"                     \"\u003c\": operator.lt,"},{"line_number":605,"context_line":"                     \"\u003e\": operator.gt,"},{"line_number":606,"context_line":"                     \"\u003c\u003d\": operator.le,"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FBho%3D","line":603,"updated":"2014-01-18 17:13:51.000000000","message":"Static data like this should go in class attributes so we don\u0027t have to build the same dictionary every time the method is invoked.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"19afcd57b083ccb7cb9b678db420b386ba581801","unresolved":false,"context_lines":[{"line_number":600,"context_line":""},{"line_number":601,"context_line":"    def _transform_expression(self, expression_tree, table):"},{"line_number":602,"context_line":""},{"line_number":603,"context_line":"        operators \u003d {\"\u003d\": operator.eq,"},{"line_number":604,"context_line":"                     \"\u003c\": operator.lt,"},{"line_number":605,"context_line":"                     \"\u003e\": operator.gt,"},{"line_number":606,"context_line":"                     \"\u003c\u003d\": operator.le,"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FAMM%3D","line":603,"in_reply_to":"AAAAUH%2F%2FBho%3D","updated":"2014-01-20 10:15:09.000000000","message":"Done","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"ce99d1a204bc12b1f28e4d6e7657eea748db3324","unresolved":false,"context_lines":[{"line_number":561,"context_line":"            return []"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"        table \u003d models.Meter"},{"line_number":564,"context_line":"        session \u003d sqlalchemy_session.get_session()"},{"line_number":565,"context_line":"        query \u003d session.query(table)"},{"line_number":566,"context_line":"        query \u003d make_query_from_filter(session, query, sample_filter,"},{"line_number":567,"context_line":"                                       require_meter\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F9boA%3D","line":564,"updated":"2014-02-06 23:28:19.000000000","message":"this needs a rebase to use _get_db_session():","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b11e95f11242787b62244db9ba676b846b42983b","unresolved":false,"context_lines":[{"line_number":561,"context_line":"            return []"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"        table \u003d models.Meter"},{"line_number":564,"context_line":"        session \u003d sqlalchemy_session.get_session()"},{"line_number":565,"context_line":"        query \u003d session.query(table)"},{"line_number":566,"context_line":"        query \u003d make_query_from_filter(session, query, sample_filter,"},{"line_number":567,"context_line":"                                       require_meter\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUX%2F%2F4dU%3D","line":564,"in_reply_to":"AAAAUH%2F9boA%3D","updated":"2014-02-10 14:47:22.000000000","message":"Done","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"}],"ceilometer/tests/api/v2/test_complex_query.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        self.limit \u003d limit"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class TestComplexQuery(test.BaseTestCase):"},{"line_number":37,"context_line":"    def setUp(self):"},{"line_number":38,"context_line":"        super(TestComplexQuery, self).setUp()"},{"line_number":39,"context_line":"        self.useFixture(fixtures.MonkeyPatch("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9ISI%3D","line":36,"updated":"2013-12-16 14:56:30.000000000","message":"Missing a testcase with a multi-level, mixed, unbalanced query tree?\n\ne.g.\n\n       filter \u003d [\"and\",\n                   [\"\u003d\", \"foo\", \"bar\"],\n                   [\"or\"\n                     [\"!\u003d\", \"situation\", \"snafu\"],\n                     [\"\u003e\u003d\", \"timestamp\", \"2013-12-06T19:38:29Z\"]\n                   ]\n                 ]","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5ca16af4524ff7e14d5a7688848c6cee34695dd4","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        self.limit \u003d limit"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class TestComplexQuery(test.BaseTestCase):"},{"line_number":37,"context_line":"    def setUp(self):"},{"line_number":38,"context_line":"        super(TestComplexQuery, self).setUp()"},{"line_number":39,"context_line":"        self.useFixture(fixtures.MonkeyPatch("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9C6k%3D","line":36,"in_reply_to":"AAAATn%2F9ISI%3D","updated":"2013-12-17 14:22:55.000000000","message":"Done","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"}],"ceilometer/tests/api/v2/test_complex_query_scenarios.py":[{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"2ec3f7249a4b273e31965a544e4665e5e349d32d","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from ceilometer.openstack.common import timeutils"},{"line_number":27,"context_line":"from ceilometer.publisher import rpc"},{"line_number":28,"context_line":"from ceilometer import sample"},{"line_number":29,"context_line":"from ceilometer.tests.api.v2 import FunctionalTest"},{"line_number":30,"context_line":"from ceilometer.tests import db as tests_db"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"load_tests \u003d testscenarios.load_tests_apply_scenarios"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2FmM%3D","line":29,"updated":"2013-12-17 22:57:29.000000000","message":"Are we allowing the import of Classes directly?","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"a1a7d9fb70c0071c1e7f427f768cedd87f490b20","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from ceilometer.openstack.common import timeutils"},{"line_number":27,"context_line":"from ceilometer.publisher import rpc"},{"line_number":28,"context_line":"from ceilometer import sample"},{"line_number":29,"context_line":"from ceilometer.tests.api.v2 import FunctionalTest"},{"line_number":30,"context_line":"from ceilometer.tests import db as tests_db"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"load_tests \u003d testscenarios.load_tests_apply_scenarios"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FwfM%3D","line":29,"in_reply_to":"AAAATn%2F8%2BSs%3D","updated":"2014-01-08 19:59:06.000000000","message":"Does that mean that we should keep the bad style? I say we start walking away from importing classes directly to keep a consistent import style though out openstack projects","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"625c3a346d977908d3b05d34a987fe0bc063ac07","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from ceilometer.openstack.common import timeutils"},{"line_number":27,"context_line":"from ceilometer.publisher import rpc"},{"line_number":28,"context_line":"from ceilometer import sample"},{"line_number":29,"context_line":"from ceilometer.tests.api.v2 import FunctionalTest"},{"line_number":30,"context_line":"from ceilometer.tests import db as tests_db"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"load_tests \u003d testscenarios.load_tests_apply_scenarios"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2BSs%3D","line":29,"in_reply_to":"AAAATn%2F8%2FmM%3D","updated":"2013-12-18 08:44:04.000000000","message":"It might be seen as bad style, but we already do this a fair bit in the existing codebase:\n\n $ find ceilometer -name \"*.py\" | xargs grep -c \u0027^from [a-z.]* import [A-Z]\u0027 | grep -v \u0027:0$\u0027","commit_id":"fbcb32c1a41a645a73f183fcf89f27843e274ebd"},{"author":{"_account_id":5313,"name":"David Peraza","email":"david_peraza@persistentsys.com","username":"dperaza"},"change_message_id":"b76709b99f787534211c65494e9dce22eb70eec0","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from ceilometer.openstack.common import timeutils"},{"line_number":27,"context_line":"from ceilometer.publisher import rpc"},{"line_number":28,"context_line":"from ceilometer import sample"},{"line_number":29,"context_line":"from ceilometer.tests.api.v2 import FunctionalTest"},{"line_number":30,"context_line":"from ceilometer.tests import db as tests_db"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"load_tests \u003d testscenarios.load_tests_apply_scenarios"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2Fwbo%3D","line":29,"updated":"2014-01-08 20:16:42.000000000","message":"still think we should not import Classes directly","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"334abb66f01d03f2659cc0de533765d92c175fa6","unresolved":false,"context_lines":[{"line_number":26,"context_line":"from ceilometer.openstack.common import timeutils"},{"line_number":27,"context_line":"from ceilometer.publisher import rpc"},{"line_number":28,"context_line":"from ceilometer import sample"},{"line_number":29,"context_line":"from ceilometer.tests.api.v2 import FunctionalTest"},{"line_number":30,"context_line":"from ceilometer.tests import db as tests_db"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"load_tests \u003d testscenarios.load_tests_apply_scenarios"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2FluA%3D","line":29,"in_reply_to":"AAAAUH%2F%2Fwbo%3D","updated":"2014-01-10 18:17:01.000000000","message":"Done","commit_id":"d0ab65df8b92ac73b13ee3e2f64086aa16582dd4"}],"ceilometer/tests/storage/test_storage_scenarios.py":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9fa3fe1e96ae699c8310b926855de65f66b01af5","unresolved":false,"context_lines":[{"line_number":727,"context_line":""},{"line_number":728,"context_line":"    def _create_samples(self):"},{"line_number":729,"context_line":"        for resource in range(42, 45):"},{"line_number":730,"context_line":"            for volume in [0.39, 0.4, 0.41, 0.79, 0.8, 0.81]:"},{"line_number":731,"context_line":"                self.create_and_store_sample(resource_id\u003d\"resource-id-%s\""},{"line_number":732,"context_line":"                                                         % resource,"},{"line_number":733,"context_line":"                                             name\u003d\"cpu_util\","}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9IQk%3D","line":730,"updated":"2013-12-16 14:56:30.000000000","message":"Randomize volume ordering?","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"5ca16af4524ff7e14d5a7688848c6cee34695dd4","unresolved":false,"context_lines":[{"line_number":727,"context_line":""},{"line_number":728,"context_line":"    def _create_samples(self):"},{"line_number":729,"context_line":"        for resource in range(42, 45):"},{"line_number":730,"context_line":"            for volume in [0.39, 0.4, 0.41, 0.79, 0.8, 0.81]:"},{"line_number":731,"context_line":"                self.create_and_store_sample(resource_id\u003d\"resource-id-%s\""},{"line_number":732,"context_line":"                                                         % resource,"},{"line_number":733,"context_line":"                                             name\u003d\"cpu_util\","}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9C9I%3D","line":730,"in_reply_to":"AAAATn%2F9IQk%3D","updated":"2013-12-17 14:22:55.000000000","message":"Done","commit_id":"1d79568cfeabfb02573e6c70d674405b750a6264"}],"ceilometer/utils.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"68d619bddc5308d2b9a229d39c37973f6b80b636","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                yield key_gen, v"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"def lowercase_keys(subfilter):"},{"line_number":122,"context_line":"    \"\"\"Converts the key value to lower case.\"\"\""},{"line_number":123,"context_line":"    key \u003d subfilter.keys()[0]"},{"line_number":124,"context_line":"    value \u003d subfilter[key]"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2FBhY%3D","line":121,"updated":"2014-01-18 17:13:51.000000000","message":"This assumes subfilter is a dictionary containing one item. Is that a valid assumption?","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"19afcd57b083ccb7cb9b678db420b386ba581801","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                yield key_gen, v"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"def lowercase_keys(subfilter):"},{"line_number":122,"context_line":"    \"\"\"Converts the key value to lower case.\"\"\""},{"line_number":123,"context_line":"    key \u003d subfilter.keys()[0]"},{"line_number":124,"context_line":"    value \u003d subfilter[key]"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2B%2Bco%3D","line":121,"in_reply_to":"AAAAUH%2F%2FBhY%3D","updated":"2014-01-20 10:15:09.000000000","message":"Yes, it is a valid assumption, this function replace the key in a single-element dict to the lower case value of the key. The function was changed to replace all the keys in the dict that was received in the inline parameter.\n\nThe lowercase_values function has also been changed.","commit_id":"38fb40b43b2180eb05441e32b0998be44e46913e"},{"author":{"_account_id":7478,"name":"Nadya Shakhat","email":"nadmi4@gmail.com","username":"nprivalova"},"change_message_id":"7a86078b470d082283bcded429d4db5eb94b405f","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            else:"},{"line_number":118,"context_line":"                yield key_gen, v"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"def lowercase_keys(mapping):"},{"line_number":122,"context_line":"    \"\"\"Converts the values of the keys in mapping to lower case.\"\"\""},{"line_number":123,"context_line":"    items \u003d mapping.items()"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F9XPk%3D","line":120,"updated":"2014-02-07 13:24:51.000000000","message":"Just a suggestion: do you use this 2 func separately? Maybe lowercase_map(lowercase_only_keys\u003dtrue) will be more useful?","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b11e95f11242787b62244db9ba676b846b42983b","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            else:"},{"line_number":118,"context_line":"                yield key_gen, v"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"def lowercase_keys(mapping):"},{"line_number":122,"context_line":"    \"\"\"Converts the values of the keys in mapping to lower case.\"\"\""},{"line_number":123,"context_line":"    items \u003d mapping.items()"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUX%2F%2F4ak%3D","line":120,"in_reply_to":"AAAAUH%2F9XPk%3D","updated":"2014-02-10 14:47:22.000000000","message":"We use them totally separately, so for us it would not help, if I merge them into one function. If it will be needed by someone else too then it can be refactored based on the actual use case.","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"ce99d1a204bc12b1f28e4d6e7657eea748db3324","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"def lowercase_keys(mapping):"},{"line_number":122,"context_line":"    \"\"\"Converts the values of the keys in mapping to lower case.\"\"\""},{"line_number":123,"context_line":"    items \u003d mapping.items()"},{"line_number":124,"context_line":"    for key, value in items:"},{"line_number":125,"context_line":"        del mapping[key]"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F9cDs%3D","line":122,"updated":"2014-02-06 23:28:19.000000000","message":"s/lower case/lowercase/","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b11e95f11242787b62244db9ba676b846b42983b","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"def lowercase_keys(mapping):"},{"line_number":122,"context_line":"    \"\"\"Converts the values of the keys in mapping to lower case.\"\"\""},{"line_number":123,"context_line":"    items \u003d mapping.items()"},{"line_number":124,"context_line":"    for key, value in items:"},{"line_number":125,"context_line":"        del mapping[key]"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUX%2F%2F4bY%3D","line":122,"in_reply_to":"AAAAUH%2F9cDs%3D","updated":"2014-02-10 14:47:22.000000000","message":"Done","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"ce99d1a204bc12b1f28e4d6e7657eea748db3324","unresolved":false,"context_lines":[{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def lowercase_values(mapping):"},{"line_number":130,"context_line":"    \"\"\"Converts the values in the mapping dict to lower case.\"\"\""},{"line_number":131,"context_line":"    items \u003d mapping.items()"},{"line_number":132,"context_line":"    for key, value in items:"},{"line_number":133,"context_line":"        mapping[key] \u003d value.lower()"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUH%2F9cDk%3D","line":130,"updated":"2014-02-06 23:28:19.000000000","message":"s/lower case/lowercase/","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b11e95f11242787b62244db9ba676b846b42983b","unresolved":false,"context_lines":[{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def lowercase_values(mapping):"},{"line_number":130,"context_line":"    \"\"\"Converts the values in the mapping dict to lower case.\"\"\""},{"line_number":131,"context_line":"    items \u003d mapping.items()"},{"line_number":132,"context_line":"    for key, value in items:"},{"line_number":133,"context_line":"        mapping[key] \u003d value.lower()"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAUX%2F%2F4bU%3D","line":130,"in_reply_to":"AAAAUH%2F9cDk%3D","updated":"2014-02-10 14:47:22.000000000","message":"Done","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"}],"doc/source/webapi/v2.rst":[{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"1edd9f93dcbf5d0f9ad47109e5a4168807b56693","unresolved":false,"context_lines":[{"line_number":60,"context_line":"Filtering Queries"},{"line_number":61,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":62,"context_line":"Ceilometer\u0027s REST API currently supports two types of queries. The Simple"},{"line_number":63,"context_line":"Query functionality provides a simple filtering on several fields of the"},{"line_number":64,"context_line":"*Sample* type. Complex Query provides the possibility to specify queries"},{"line_number":65,"context_line":"with arithmetic and logical operators on the fields of *Sample*."},{"line_number":66,"context_line":""}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BLgE%3D","line":63,"updated":"2014-01-29 11:55:24.000000000","message":"s/provides a simple filtering/provides simple filtering/","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c2c0f9dcebcc0b5a3b9419483e51a97b87d97807","unresolved":false,"context_lines":[{"line_number":60,"context_line":"Filtering Queries"},{"line_number":61,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":62,"context_line":"Ceilometer\u0027s REST API currently supports two types of queries. The Simple"},{"line_number":63,"context_line":"Query functionality provides a simple filtering on several fields of the"},{"line_number":64,"context_line":"*Sample* type. Complex Query provides the possibility to specify queries"},{"line_number":65,"context_line":"with arithmetic and logical operators on the fields of *Sample*."},{"line_number":66,"context_line":""}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BFXA%3D","line":63,"in_reply_to":"AAAAUH%2F%2BLgE%3D","updated":"2014-01-30 11:12:52.000000000","message":"Done","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"1edd9f93dcbf5d0f9ad47109e5a4168807b56693","unresolved":false,"context_lines":[{"line_number":62,"context_line":"Ceilometer\u0027s REST API currently supports two types of queries. The Simple"},{"line_number":63,"context_line":"Query functionality provides a simple filtering on several fields of the"},{"line_number":64,"context_line":"*Sample* type. Complex Query provides the possibility to specify queries"},{"line_number":65,"context_line":"with arithmetic and logical operators on the fields of *Sample*."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"You may also apply filters based on the values of one or more of the"},{"line_number":68,"context_line":"*resource_metadata* field, in which case you should target *metadata.\u003cfield\u003e*,"}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BLfo%3D","line":65,"updated":"2014-01-29 11:55:24.000000000","message":"To me an arithmetic operator connotes +, -, *, /, % etc.\n\nHow about:\n\ns/with arithmetic and logical operators/with logical and comparison operators/","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c2c0f9dcebcc0b5a3b9419483e51a97b87d97807","unresolved":false,"context_lines":[{"line_number":62,"context_line":"Ceilometer\u0027s REST API currently supports two types of queries. The Simple"},{"line_number":63,"context_line":"Query functionality provides a simple filtering on several fields of the"},{"line_number":64,"context_line":"*Sample* type. Complex Query provides the possibility to specify queries"},{"line_number":65,"context_line":"with arithmetic and logical operators on the fields of *Sample*."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"You may also apply filters based on the values of one or more of the"},{"line_number":68,"context_line":"*resource_metadata* field, in which case you should target *metadata.\u003cfield\u003e*,"}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BFWo%3D","line":65,"in_reply_to":"AAAAUH%2F%2BLfo%3D","updated":"2014-01-30 11:12:52.000000000","message":"Done","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"1edd9f93dcbf5d0f9ad47109e5a4168807b56693","unresolved":false,"context_lines":[{"line_number":65,"context_line":"with arithmetic and logical operators on the fields of *Sample*."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"You may also apply filters based on the values of one or more of the"},{"line_number":68,"context_line":"*resource_metadata* field, in which case you should target *metadata.\u003cfield\u003e*,"},{"line_number":69,"context_line":"with both types of queries. Notice, however, that given the free-form nature of"},{"line_number":70,"context_line":"*resource_metadata* field, there is no practical or consistent way to"},{"line_number":71,"context_line":"validate the query fields under *metadata* domain like it is done for all other"}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BLfA%3D","line":68,"updated":"2014-01-29 11:55:24.000000000","message":"s/in which case you should target *metadata.\u003cfield\u003e*, with both types of queries/which you may identify with *metadata.\u003cfield\u003e* in either type of query/","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c2c0f9dcebcc0b5a3b9419483e51a97b87d97807","unresolved":false,"context_lines":[{"line_number":65,"context_line":"with arithmetic and logical operators on the fields of *Sample*."},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"You may also apply filters based on the values of one or more of the"},{"line_number":68,"context_line":"*resource_metadata* field, in which case you should target *metadata.\u003cfield\u003e*,"},{"line_number":69,"context_line":"with both types of queries. Notice, however, that given the free-form nature of"},{"line_number":70,"context_line":"*resource_metadata* field, there is no practical or consistent way to"},{"line_number":71,"context_line":"validate the query fields under *metadata* domain like it is done for all other"}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BFVg%3D","line":68,"in_reply_to":"AAAAUH%2F%2BLfA%3D","updated":"2014-01-30 11:12:52.000000000","message":"Done","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"1edd9f93dcbf5d0f9ad47109e5a4168807b56693","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"You may also apply filters based on the values of one or more of the"},{"line_number":68,"context_line":"*resource_metadata* field, in which case you should target *metadata.\u003cfield\u003e*,"},{"line_number":69,"context_line":"with both types of queries. Notice, however, that given the free-form nature of"},{"line_number":70,"context_line":"*resource_metadata* field, there is no practical or consistent way to"},{"line_number":71,"context_line":"validate the query fields under *metadata* domain like it is done for all other"},{"line_number":72,"context_line":"fields."}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BLe0%3D","line":69,"updated":"2014-01-29 11:55:24.000000000","message":"s/Notice, however,/Note, however,/","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c2c0f9dcebcc0b5a3b9419483e51a97b87d97807","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"You may also apply filters based on the values of one or more of the"},{"line_number":68,"context_line":"*resource_metadata* field, in which case you should target *metadata.\u003cfield\u003e*,"},{"line_number":69,"context_line":"with both types of queries. Notice, however, that given the free-form nature of"},{"line_number":70,"context_line":"*resource_metadata* field, there is no practical or consistent way to"},{"line_number":71,"context_line":"validate the query fields under *metadata* domain like it is done for all other"},{"line_number":72,"context_line":"fields."}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BFU8%3D","line":69,"in_reply_to":"AAAAUH%2F%2BLe0%3D","updated":"2014-01-30 11:12:52.000000000","message":"Done","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"1edd9f93dcbf5d0f9ad47109e5a4168807b56693","unresolved":false,"context_lines":[{"line_number":71,"context_line":"validate the query fields under *metadata* domain like it is done for all other"},{"line_number":72,"context_line":"fields."},{"line_number":73,"context_line":""},{"line_number":74,"context_line":".. note:: The API call will return HTTP 200 in both scenarios:"},{"line_number":75,"context_line":"when a query with *metadata.\u003cfield\u003e* does not match its value, and"},{"line_number":76,"context_line":"when *\u003cfield\u003e* itself does not exist in any of the records being queried."},{"line_number":77,"context_line":""}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BLec%3D","line":74,"updated":"2014-01-29 11:55:24.000000000","message":"s/will return HTTP 200 in both scenarios/will return a HTTP 200 OK status for both of the following cases/","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c2c0f9dcebcc0b5a3b9419483e51a97b87d97807","unresolved":false,"context_lines":[{"line_number":71,"context_line":"validate the query fields under *metadata* domain like it is done for all other"},{"line_number":72,"context_line":"fields."},{"line_number":73,"context_line":""},{"line_number":74,"context_line":".. note:: The API call will return HTTP 200 in both scenarios:"},{"line_number":75,"context_line":"when a query with *metadata.\u003cfield\u003e* does not match its value, and"},{"line_number":76,"context_line":"when *\u003cfield\u003e* itself does not exist in any of the records being queried."},{"line_number":77,"context_line":""}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BFUg%3D","line":74,"in_reply_to":"AAAAUH%2F%2BLec%3D","updated":"2014-01-30 11:12:52.000000000","message":"Done","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"1edd9f93dcbf5d0f9ad47109e5a4168807b56693","unresolved":false,"context_lines":[{"line_number":93,"context_line":"of *Sample*. The following comparison operators are supported: *\u003d*, *!\u003d*, *\u003c*,"},{"line_number":94,"context_line":"*\u003c\u003d*, *\u003e* and *\u003e\u003d*; and the following logical operators can be used: *and* and *or*."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"Complex Query supports defining the list of order by expressions in the form"},{"line_number":97,"context_line":"of [{\"field_name\": \"asc\"}, {\"field_name2\": \"desc\"}, ...]."},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"The number of the returned rows can be limited, by using the *limit* option."}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BLdU%3D","line":96,"updated":"2014-01-29 11:55:24.000000000","message":"s/order by/orderby/","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c2c0f9dcebcc0b5a3b9419483e51a97b87d97807","unresolved":false,"context_lines":[{"line_number":93,"context_line":"of *Sample*. The following comparison operators are supported: *\u003d*, *!\u003d*, *\u003c*,"},{"line_number":94,"context_line":"*\u003c\u003d*, *\u003e* and *\u003e\u003d*; and the following logical operators can be used: *and* and *or*."},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"Complex Query supports defining the list of order by expressions in the form"},{"line_number":97,"context_line":"of [{\"field_name\": \"asc\"}, {\"field_name2\": \"desc\"}, ...]."},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"The number of the returned rows can be limited, by using the *limit* option."}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BFUY%3D","line":96,"in_reply_to":"AAAAUH%2F%2BLdU%3D","updated":"2014-01-30 11:12:52.000000000","message":"Done","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"1edd9f93dcbf5d0f9ad47109e5a4168807b56693","unresolved":false,"context_lines":[{"line_number":96,"context_line":"Complex Query supports defining the list of order by expressions in the form"},{"line_number":97,"context_line":"of [{\"field_name\": \"asc\"}, {\"field_name2\": \"desc\"}, ...]."},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"The number of the returned rows can be limited, by using the *limit* option."},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"The *filter*, *orderby* and *limit* are all optional fields in a query."},{"line_number":102,"context_line":""}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BLeI%3D","line":99,"updated":"2014-01-29 11:55:24.000000000","message":"rows is a tad SQL-ish ... maybe items?\n\ne.g.\n\nThe number of returned items can be bounded using the *limit* option.","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c2c0f9dcebcc0b5a3b9419483e51a97b87d97807","unresolved":false,"context_lines":[{"line_number":96,"context_line":"Complex Query supports defining the list of order by expressions in the form"},{"line_number":97,"context_line":"of [{\"field_name\": \"asc\"}, {\"field_name2\": \"desc\"}, ...]."},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"The number of the returned rows can be limited, by using the *limit* option."},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"The *filter*, *orderby* and *limit* are all optional fields in a query."},{"line_number":102,"context_line":""}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BFUQ%3D","line":99,"in_reply_to":"AAAAUH%2F%2BLeI%3D","updated":"2014-01-30 11:12:52.000000000","message":"Done","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"1edd9f93dcbf5d0f9ad47109e5a4168807b56693","unresolved":false,"context_lines":[{"line_number":404,"context_line":"This example demonstraits how complex query filter expressions can be generated and sent"},{"line_number":405,"context_line":"to the /v2/query/samples endpoint of Ceilometer API using POST request."},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"To check for *cpu_util* samples reported between 18:00-18:15 or between 18:30 - 18:45,"},{"line_number":408,"context_line":"where the utilization is between 23 and 26 percent, the following filter expression can"},{"line_number":409,"context_line":"be created::"},{"line_number":410,"context_line":""}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BLd4%3D","line":407,"updated":"2014-01-29 11:55:24.000000000","message":"... on a particular date (2013-12-01)","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c2c0f9dcebcc0b5a3b9419483e51a97b87d97807","unresolved":false,"context_lines":[{"line_number":404,"context_line":"This example demonstraits how complex query filter expressions can be generated and sent"},{"line_number":405,"context_line":"to the /v2/query/samples endpoint of Ceilometer API using POST request."},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"To check for *cpu_util* samples reported between 18:00-18:15 or between 18:30 - 18:45,"},{"line_number":408,"context_line":"where the utilization is between 23 and 26 percent, the following filter expression can"},{"line_number":409,"context_line":"be created::"},{"line_number":410,"context_line":""}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BFT4%3D","line":407,"in_reply_to":"AAAAUH%2F%2BLd4%3D","updated":"2014-01-30 11:12:52.000000000","message":"Done","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"1edd9f93dcbf5d0f9ad47109e5a4168807b56693","unresolved":false,"context_lines":[{"line_number":439,"context_line":"\t\"limit\" : 4"},{"line_number":440,"context_line":"\t}"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"If the query above was saved in body.txt, the request will be the following::"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"\tcurl -X POST -H \u0027X-Auth-Token: \u003cinserttokenhere\u003e\u0027 -H \u0027Content-Type: application/json\u0027 \\"},{"line_number":445,"context_line":"\t  -d @body.txt \\"}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BLc4%3D","line":442,"updated":"2014-01-29 11:55:24.000000000","message":"An alternative to introducing a temporary file (body.txt) would be to simple use the -d string form on the command line. i.e\n\n  curl -X POST ... -d \u0027{\"filter\" : \"{\\\"and\\\":[{\\\"and\\\": [{\\\"\u003d\\\": {\\\"counter_name\\\": \\\"cpu_util\\\"}},...\u0027 http://localhost:8777/v2/query/samples","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"c2c0f9dcebcc0b5a3b9419483e51a97b87d97807","unresolved":false,"context_lines":[{"line_number":439,"context_line":"\t\"limit\" : 4"},{"line_number":440,"context_line":"\t}"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"If the query above was saved in body.txt, the request will be the following::"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"\tcurl -X POST -H \u0027X-Auth-Token: \u003cinserttokenhere\u003e\u0027 -H \u0027Content-Type: application/json\u0027 \\"},{"line_number":445,"context_line":"\t  -d @body.txt \\"}],"source_content_type":"text/x-rst","patch_set":11,"id":"AAAAUH%2F%2BFQE%3D","line":442,"in_reply_to":"AAAAUH%2F%2BLc4%3D","updated":"2014-01-30 11:12:52.000000000","message":"I finally included an \u003cinsertyourqueryexpressionhere\u003e, like the example in the User-defined data section.","commit_id":"6ef3559d5e01f09ffd6e2ad51f3215f6e7fd4c22"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"ce99d1a204bc12b1f28e4d6e7657eea748db3324","unresolved":false,"context_lines":[{"line_number":402,"context_line":"Functional example for Complex Query"},{"line_number":403,"context_line":"++++++++++++++++++++++++++++++++++++"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":"This example demonstraits how complex query filter expressions can be generated and sent"},{"line_number":406,"context_line":"to the /v2/query/samples endpoint of Ceilometer API using POST request."},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"To check for *cpu_util* samples reported between 18:00-18:15 or between 18:30 - 18:45"}],"source_content_type":"text/x-rst","patch_set":13,"id":"AAAAUH%2F9cIQ%3D","line":405,"updated":"2014-02-06 23:28:19.000000000","message":"s/demonstraits/demonstrates/","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b11e95f11242787b62244db9ba676b846b42983b","unresolved":false,"context_lines":[{"line_number":402,"context_line":"Functional example for Complex Query"},{"line_number":403,"context_line":"++++++++++++++++++++++++++++++++++++"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":"This example demonstraits how complex query filter expressions can be generated and sent"},{"line_number":406,"context_line":"to the /v2/query/samples endpoint of Ceilometer API using POST request."},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"To check for *cpu_util* samples reported between 18:00-18:15 or between 18:30 - 18:45"}],"source_content_type":"text/x-rst","patch_set":13,"id":"AAAAUX%2F%2F4aQ%3D","line":405,"in_reply_to":"AAAAUH%2F9cIQ%3D","updated":"2014-02-10 14:47:22.000000000","message":"Done","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"ce99d1a204bc12b1f28e4d6e7657eea748db3324","unresolved":false,"context_lines":[{"line_number":414,"context_line":"      [{\"\u003d\": {\"counter_name\": \"cpu_util\"}},"},{"line_number":415,"context_line":"       {\"\u003e\": {\"counter_volume\": 0.23}},"},{"line_number":416,"context_line":"       {\"\u003c\": {\"counter_volume\": 0.26}}]},"},{"line_number":417,"context_line":"     [{\"or\":"},{"line_number":418,"context_line":"      [{\"and\":"},{"line_number":419,"context_line":"       [{\"\u003e\": {\"timestamp\": \"2013-12-01T18:00:00\"}},"},{"line_number":420,"context_line":"        {\"\u003c\": {\"timestamp\": \"2013-12-01T18:15:00\"}}]},"}],"source_content_type":"text/x-rst","patch_set":13,"id":"AAAAUH%2F9cEo%3D","line":417,"updated":"2014-02-06 23:28:19.000000000","message":"can you verify this example. it looks off: is the opening square bracket needed before the or?","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b11e95f11242787b62244db9ba676b846b42983b","unresolved":false,"context_lines":[{"line_number":414,"context_line":"      [{\"\u003d\": {\"counter_name\": \"cpu_util\"}},"},{"line_number":415,"context_line":"       {\"\u003e\": {\"counter_volume\": 0.23}},"},{"line_number":416,"context_line":"       {\"\u003c\": {\"counter_volume\": 0.26}}]},"},{"line_number":417,"context_line":"     [{\"or\":"},{"line_number":418,"context_line":"      [{\"and\":"},{"line_number":419,"context_line":"       [{\"\u003e\": {\"timestamp\": \"2013-12-01T18:00:00\"}},"},{"line_number":420,"context_line":"        {\"\u003c\": {\"timestamp\": \"2013-12-01T18:15:00\"}}]},"}],"source_content_type":"text/x-rst","patch_set":13,"id":"AAAAUX%2F%2F4XI%3D","line":417,"in_reply_to":"AAAAUH%2F9cEo%3D","updated":"2014-02-10 14:47:22.000000000","message":"No it is not, I forgot to remove it, when I refactored this example from the previous representation to this one.\n\nDone","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"ce99d1a204bc12b1f28e4d6e7657eea748db3324","unresolved":false,"context_lines":[{"line_number":418,"context_line":"      [{\"and\":"},{"line_number":419,"context_line":"       [{\"\u003e\": {\"timestamp\": \"2013-12-01T18:00:00\"}},"},{"line_number":420,"context_line":"        {\"\u003c\": {\"timestamp\": \"2013-12-01T18:15:00\"}}]},"},{"line_number":421,"context_line":"        {\"and\":"},{"line_number":422,"context_line":"         [{\"\u003e\": {\"timestamp\": \"2013-12-01T18:30:00\"}},"},{"line_number":423,"context_line":"          {\"\u003c\": {\"timestamp\": \"2013-12-01T18:45:00\"}}]}]}]]}"},{"line_number":424,"context_line":""}],"source_content_type":"text/x-rst","patch_set":13,"id":"AAAAUH%2F9cEQ%3D","line":421,"updated":"2014-02-06 23:28:19.000000000","message":"should this and not be on the same level as previous and?","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b11e95f11242787b62244db9ba676b846b42983b","unresolved":false,"context_lines":[{"line_number":418,"context_line":"      [{\"and\":"},{"line_number":419,"context_line":"       [{\"\u003e\": {\"timestamp\": \"2013-12-01T18:00:00\"}},"},{"line_number":420,"context_line":"        {\"\u003c\": {\"timestamp\": \"2013-12-01T18:15:00\"}}]},"},{"line_number":421,"context_line":"        {\"and\":"},{"line_number":422,"context_line":"         [{\"\u003e\": {\"timestamp\": \"2013-12-01T18:30:00\"}},"},{"line_number":423,"context_line":"          {\"\u003c\": {\"timestamp\": \"2013-12-01T18:45:00\"}}]}]}]]}"},{"line_number":424,"context_line":""}],"source_content_type":"text/x-rst","patch_set":13,"id":"AAAAUX%2F%2F4W4%3D","line":421,"in_reply_to":"AAAAUH%2F9cEQ%3D","updated":"2014-02-10 14:47:22.000000000","message":"Yes, it should, good catch.\n\nDone","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"ce99d1a204bc12b1f28e4d6e7657eea748db3324","unresolved":false,"context_lines":[{"line_number":431,"context_line":""},{"line_number":432,"context_line":"As the current implementation accepts only string values as query filter and order by"},{"line_number":433,"context_line":"definitions, the above defined expressions have to be converted to string values."},{"line_number":434,"context_line":"With adding a limit criteria to the request, which maximizes the number of returned samples"},{"line_number":435,"context_line":"in four, the query looks like the following::"},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"    {"}],"source_content_type":"text/x-rst","patch_set":13,"id":"AAAAUH%2F9cAI%3D","line":434,"updated":"2014-02-06 23:28:19.000000000","message":"s/With adding/By adding/","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b11e95f11242787b62244db9ba676b846b42983b","unresolved":false,"context_lines":[{"line_number":431,"context_line":""},{"line_number":432,"context_line":"As the current implementation accepts only string values as query filter and order by"},{"line_number":433,"context_line":"definitions, the above defined expressions have to be converted to string values."},{"line_number":434,"context_line":"With adding a limit criteria to the request, which maximizes the number of returned samples"},{"line_number":435,"context_line":"in four, the query looks like the following::"},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"    {"}],"source_content_type":"text/x-rst","patch_set":13,"id":"AAAAUX%2F%2F4aI%3D","line":434,"in_reply_to":"AAAAUH%2F9cAI%3D","updated":"2014-02-10 14:47:22.000000000","message":"Done","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"ce99d1a204bc12b1f28e4d6e7657eea748db3324","unresolved":false,"context_lines":[{"line_number":432,"context_line":"As the current implementation accepts only string values as query filter and order by"},{"line_number":433,"context_line":"definitions, the above defined expressions have to be converted to string values."},{"line_number":434,"context_line":"With adding a limit criteria to the request, which maximizes the number of returned samples"},{"line_number":435,"context_line":"in four, the query looks like the following::"},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"    {"},{"line_number":438,"context_line":"    \"filter\" : \"{\\\"and\\\":[{\\\"and\\\": [{\\\"\u003d\\\": {\\\"counter_name\\\": \\\"cpu_util\\\"}}, {\\\"\u003e\\\": {\\\"counter_volume\\\": 0.23}}, {\\\"\u003c\\\": {\\\"counter_volume\\\": 0.26}}]}, [{\\\"or\\\": [{\\\"and\\\": [{\\\"\u003e\\\": {\\\"timestamp\\\": \\\"2013-12-01T18:00:00\\\"}}, {\\\"\u003c\\\": {\\\"timestamp\\\": \\\"2013-12-01T18:15:00\\\"}}]}, {\\\"and\\\": [{\\\"\u003e\\\": {\\\"timestamp\\\": \\\"2013-12-01T18:30:00\\\"}}, {\\\"\u003c\\\": {\\\"timestamp\\\": \\\"2013-12-01T18:45:00\\\"}}]}]}]]}\","}],"source_content_type":"text/x-rst","patch_set":13,"id":"AAAAUH%2F9b%2F8%3D","line":435,"updated":"2014-02-06 23:28:19.000000000","message":"s/in four/to four/","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b11e95f11242787b62244db9ba676b846b42983b","unresolved":false,"context_lines":[{"line_number":432,"context_line":"As the current implementation accepts only string values as query filter and order by"},{"line_number":433,"context_line":"definitions, the above defined expressions have to be converted to string values."},{"line_number":434,"context_line":"With adding a limit criteria to the request, which maximizes the number of returned samples"},{"line_number":435,"context_line":"in four, the query looks like the following::"},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"    {"},{"line_number":438,"context_line":"    \"filter\" : \"{\\\"and\\\":[{\\\"and\\\": [{\\\"\u003d\\\": {\\\"counter_name\\\": \\\"cpu_util\\\"}}, {\\\"\u003e\\\": {\\\"counter_volume\\\": 0.23}}, {\\\"\u003c\\\": {\\\"counter_volume\\\": 0.26}}]}, [{\\\"or\\\": [{\\\"and\\\": [{\\\"\u003e\\\": {\\\"timestamp\\\": \\\"2013-12-01T18:00:00\\\"}}, {\\\"\u003c\\\": {\\\"timestamp\\\": \\\"2013-12-01T18:15:00\\\"}}]}, {\\\"and\\\": [{\\\"\u003e\\\": {\\\"timestamp\\\": \\\"2013-12-01T18:30:00\\\"}}, {\\\"\u003c\\\": {\\\"timestamp\\\": \\\"2013-12-01T18:45:00\\\"}}]}]}]]}\","}],"source_content_type":"text/x-rst","patch_set":13,"id":"AAAAUX%2F%2F4Zo%3D","line":435,"in_reply_to":"AAAAUH%2F9b%2F8%3D","updated":"2014-02-10 14:47:22.000000000","message":"Done","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":7478,"name":"Nadya Shakhat","email":"nadmi4@gmail.com","username":"nprivalova"},"change_message_id":"7a86078b470d082283bcded429d4db5eb94b405f","unresolved":false,"context_lines":[{"line_number":440,"context_line":"    \"limit\" : 4"},{"line_number":441,"context_line":"    }"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"A query request looks like the following with curl::"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"    curl -X POST -H \u0027X-Auth-Token: \u003cinserttokenhere\u003e\u0027 -H \u0027Content-Type: application/json\u0027 \\"},{"line_number":446,"context_line":"      -d \u0027\u003cinsertyourqueryexpressionhere\u003e\u0027 \\"}],"source_content_type":"text/x-rst","patch_set":13,"id":"AAAAUH%2F9XQY%3D","line":443,"updated":"2014-02-07 13:24:51.000000000","message":"If you correct Gordon\u0027s comments, please add specific example here. I mean add real filter after -d","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"},{"author":{"_account_id":9562,"name":"Ildiko Vancsa","email":"ildiko.vancsa@gmail.com","username":"ildikov"},"change_message_id":"b11e95f11242787b62244db9ba676b846b42983b","unresolved":false,"context_lines":[{"line_number":440,"context_line":"    \"limit\" : 4"},{"line_number":441,"context_line":"    }"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"A query request looks like the following with curl::"},{"line_number":444,"context_line":""},{"line_number":445,"context_line":"    curl -X POST -H \u0027X-Auth-Token: \u003cinserttokenhere\u003e\u0027 -H \u0027Content-Type: application/json\u0027 \\"},{"line_number":446,"context_line":"      -d \u0027\u003cinsertyourqueryexpressionhere\u003e\u0027 \\"}],"source_content_type":"text/x-rst","patch_set":13,"id":"AAAAUX%2F%2F4YY%3D","line":443,"in_reply_to":"AAAAUH%2F9XQY%3D","updated":"2014-02-10 14:47:22.000000000","message":"I chose to add the example here like below, in the User-defined data section, as it is more readable this way and shows better what should be done.","commit_id":"8c54a957c059c2e5b37783959d6bbdc626eae50b"}]}
