)]}'
{"ceilometer/storage/impl_mongodb.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cb3adf44699cf8227a26dfca3bca3a14d86fa8a0","unresolved":false,"context_lines":[{"line_number":730,"context_line":"        if groupby:"},{"line_number":731,"context_line":"            for group in groupby:"},{"line_number":732,"context_line":"                if group not in [\u0027user_id\u0027, \u0027project_id\u0027,"},{"line_number":733,"context_line":"                                 \u0027resource_id\u0027, \u0027source\u0027]:"},{"line_number":734,"context_line":"                    raise NotImplementedError("},{"line_number":735,"context_line":"                        \"Unable to group by these fields\")"},{"line_number":736,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAARn%2F%2Fwew%3D","line":733,"updated":"2013-08-22 08:03:55.000000000","message":"Trick, you can use set() to have a more idiomatic check:\n\nif set(groubpy) - set([\u0027user_id\u0027], \u0027project_id\u0027, \u0027resource_id\u0027, \u0027source\u0027]):\n   raise NotImplementedError(...)","commit_id":"b26cfd69bd6e2f130e583c2479aa5db1cc3e3790"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cb3adf44699cf8227a26dfca3bca3a14d86fa8a0","unresolved":false,"context_lines":[{"line_number":745,"context_line":"                                    pymongo.ASCENDING)])[0][\u0027timestamp\u0027]"},{"line_number":746,"context_line":"            period_start \u003d int(calendar.timegm(period_start.utctimetuple()))"},{"line_number":747,"context_line":"            if groupby:"},{"line_number":748,"context_line":"                map_stats \u003d self.MAP_STATS_PERIOD_GROUPBY % (period,"},{"line_number":749,"context_line":"                                                             period_start,"},{"line_number":750,"context_line":"                                                             str(groupby))"},{"line_number":751,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAARn%2F%2FwcM%3D","line":748,"updated":"2013-08-22 08:03:55.000000000","message":"To make the code more readable, I suggest you change the various %s to %(somefieldname)s\n\nYou\u0027ll have to pass a dict after the modulo operator instad of (value1, value2…), and it would be more readable.","commit_id":"b26cfd69bd6e2f130e583c2479aa5db1cc3e3790"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cb3adf44699cf8227a26dfca3bca3a14d86fa8a0","unresolved":false,"context_lines":[{"line_number":747,"context_line":"            if groupby:"},{"line_number":748,"context_line":"                map_stats \u003d self.MAP_STATS_PERIOD_GROUPBY % (period,"},{"line_number":749,"context_line":"                                                             period_start,"},{"line_number":750,"context_line":"                                                             str(groupby))"},{"line_number":751,"context_line":"            else:"},{"line_number":752,"context_line":"                map_stats \u003d self.MAP_STATS_PERIOD % (period, period_start)"},{"line_number":753,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAARn%2F%2FwdQ%3D","line":750,"updated":"2013-08-22 08:03:55.000000000","message":"While str(groupby) works because the syntax of JavaScript and Python for array looks alike, I think it would be more correct to use json.dumps(groupby).","commit_id":"b26cfd69bd6e2f130e583c2479aa5db1cc3e3790"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cb3adf44699cf8227a26dfca3bca3a14d86fa8a0","unresolved":false,"context_lines":[{"line_number":766,"context_line":""},{"line_number":767,"context_line":"        return sorted((models.Statistics(**(r[\u0027value\u0027]))"},{"line_number":768,"context_line":"                       for r in results[\u0027results\u0027]),"},{"line_number":769,"context_line":"                      key\u003doperator.attrgetter(\u0027period_start\u0027))"},{"line_number":770,"context_line":""},{"line_number":771,"context_line":"    @staticmethod"},{"line_number":772,"context_line":"    def _decode_matching_metadata(matching_metadata):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAARn%2F%2Fwbg%3D","line":769,"updated":"2013-08-22 08:03:55.000000000","message":"You could change that to return iter(sorted(...))\nThat would avoid changing the test like you had too.\n\nThis function *should* return an iterator, the sort that is done here in Python is not a good idea, it should be done in MongoDB. But that\u0027s not the point of this patch, so don\u0027t try to fix it right now. Just adding iter() would make the return more consistent with the other databases drivers.","commit_id":"b26cfd69bd6e2f130e583c2479aa5db1cc3e3790"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"49d58e792c328c3209b155a25162f4cf580f05ea","unresolved":false,"context_lines":[{"line_number":229,"context_line":"        \"}\")"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    PARAMS_MAP_STATS_GROUPBY \u003d {\u0027key_val\u0027: \u0027groupby_key\u0027,"},{"line_number":232,"context_line":"                                \u0027groupby_val\u0027: \u0027new Object(groupby)\u0027,"},{"line_number":233,"context_line":"                                \u0027period_start_val\u0027: \u0027this.timestamp\u0027,"},{"line_number":234,"context_line":"                                \u0027period_end_val\u0027: \u0027this.timestamp\u0027}"},{"line_number":235,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAASX%2F%2F9IM%3D","line":232,"updated":"2013-08-23 08:28:08.000000000","message":"Isn\u0027t groupby sufficient?\nIt seems to me that new Object(groupby) \u003d\u003d groupby","commit_id":"63ca5e5b7843e02aca9a3bd4d2f575f09637ff2c"},{"author":{"_account_id":7399,"name":"Terri Yu","email":"teryu@alum.mit.edu","username":"terriyu"},"change_message_id":"0249431a497f0cabcdec3d4b21b8aa33934eff95","unresolved":false,"context_lines":[{"line_number":229,"context_line":"        \"}\")"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    PARAMS_MAP_STATS_GROUPBY \u003d {\u0027key_val\u0027: \u0027groupby_key\u0027,"},{"line_number":232,"context_line":"                                \u0027groupby_val\u0027: \u0027new Object(groupby)\u0027,"},{"line_number":233,"context_line":"                                \u0027period_start_val\u0027: \u0027this.timestamp\u0027,"},{"line_number":234,"context_line":"                                \u0027period_end_val\u0027: \u0027this.timestamp\u0027}"},{"line_number":235,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAASX%2F%2F5lw%3D","line":232,"in_reply_to":"AAAASX%2F%2F9IM%3D","updated":"2013-08-24 02:03:03.000000000","message":"Yes, you\u0027re right.  Thanks for catching that!  I\u0027ll change it to simply \"groupby\".","commit_id":"63ca5e5b7843e02aca9a3bd4d2f575f09637ff2c"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"694503c188b5e5c010d2c158b01be1ff6f9db77c","unresolved":false,"context_lines":[{"line_number":250,"context_line":"        \"function () {\" +"},{"line_number":251,"context_line":"        MAP_STATS_PERIOD_VAR +"},{"line_number":252,"context_line":"        MAP_STATS_GROUPBY_VAR +"},{"line_number":253,"context_line":"        \"    groupby_key[\\\u0027period_start\\\u0027] \u003d period_start\\n\" +"},{"line_number":254,"context_line":"        EMIT_STATS_COMMON % PARAMS_MAP_STATS_PERIOD_GROUPBY +"},{"line_number":255,"context_line":"        \"}\")"},{"line_number":256,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F4Ns%3D","line":253,"updated":"2013-08-28 14:29:59.000000000","message":"this looks like we\u0027re adding a literal \u0027\\\u0027 into code.  i don\u0027t think we need to escape the single quotations here.","commit_id":"0eebdce08b3ffd15b3bf27731b717fa8f9dec628"},{"author":{"_account_id":7399,"name":"Terri Yu","email":"teryu@alum.mit.edu","username":"terriyu"},"change_message_id":"f272df5a911a24401cba89c803a478c26fd02927","unresolved":false,"context_lines":[{"line_number":250,"context_line":"        \"function () {\" +"},{"line_number":251,"context_line":"        MAP_STATS_PERIOD_VAR +"},{"line_number":252,"context_line":"        MAP_STATS_GROUPBY_VAR +"},{"line_number":253,"context_line":"        \"    groupby_key[\\\u0027period_start\\\u0027] \u003d period_start\\n\" +"},{"line_number":254,"context_line":"        EMIT_STATS_COMMON % PARAMS_MAP_STATS_PERIOD_GROUPBY +"},{"line_number":255,"context_line":"        \"}\")"},{"line_number":256,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F2rI%3D","line":253,"in_reply_to":"AAAASn%2F%2F4Ns%3D","updated":"2013-08-28 19:45:23.000000000","message":"Yes, you\u0027re right, it\u0027s not necessary.  Good catch!","commit_id":"0eebdce08b3ffd15b3bf27731b717fa8f9dec628"}],"tests/storage/base.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cb3adf44699cf8227a26dfca3bca3a14d86fa8a0","unresolved":false,"context_lines":[{"line_number":1070,"context_line":"            NotImplementedError,"},{"line_number":1071,"context_line":"            lambda: list(self.conn.get_meter_statistics(f, groupby\u003d[\u0027wtf\u0027]))"},{"line_number":1072,"context_line":"        )"},{"line_number":1073,"context_line":""},{"line_number":1074,"context_line":"    def test_group_by_metadata(self):"},{"line_number":1075,"context_line":"        pass"},{"line_number":1076,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAARn%2F%2FwbU%3D","line":1073,"updated":"2013-08-22 08:03:55.000000000","message":"See my previous comment about returning an iter() so you don\u0027t have to change that test.","commit_id":"b26cfd69bd6e2f130e583c2479aa5db1cc3e3790"}],"tests/storage/test_storage_scenarios.py":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"694503c188b5e5c010d2c158b01be1ff6f9db77c","unresolved":false,"context_lines":[{"line_number":1061,"context_line":"        )"},{"line_number":1062,"context_line":"        self.assertRaises("},{"line_number":1063,"context_line":"            NotImplementedError,"},{"line_number":1064,"context_line":"            lambda: list(self.conn.get_meter_statistics(f, groupby\u003d[\u0027wtf\u0027]))"},{"line_number":1065,"context_line":"        )"},{"line_number":1066,"context_line":""},{"line_number":1067,"context_line":"    def test_group_by_metadata(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F4UY%3D","line":1064,"updated":"2013-08-28 14:29:59.000000000","message":"you can probably do:\n\nself.assertRaises(\nNotImplementedError,\nlist,\nself.conn.get_meter_statistics(f, groupby\u003d[\u0027wtf\u0027]))\n\nit is odd that we need list() to get exception.","commit_id":"0eebdce08b3ffd15b3bf27731b717fa8f9dec628"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"af099f3385be61defb635bedd57f90506c5b52e2","unresolved":false,"context_lines":[{"line_number":1061,"context_line":"        )"},{"line_number":1062,"context_line":"        self.assertRaises("},{"line_number":1063,"context_line":"            NotImplementedError,"},{"line_number":1064,"context_line":"            lambda: list(self.conn.get_meter_statistics(f, groupby\u003d[\u0027wtf\u0027]))"},{"line_number":1065,"context_line":"        )"},{"line_number":1066,"context_line":""},{"line_number":1067,"context_line":"    def test_group_by_metadata(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F2p4%3D","line":1064,"in_reply_to":"AAAASn%2F%2F20U%3D","updated":"2013-08-28 19:58:44.000000000","message":"i see. cool cool, this is fine. i was just thinking aloud.","commit_id":"0eebdce08b3ffd15b3bf27731b717fa8f9dec628"},{"author":{"_account_id":7399,"name":"Terri Yu","email":"teryu@alum.mit.edu","username":"terriyu"},"change_message_id":"f272df5a911a24401cba89c803a478c26fd02927","unresolved":false,"context_lines":[{"line_number":1061,"context_line":"        )"},{"line_number":1062,"context_line":"        self.assertRaises("},{"line_number":1063,"context_line":"            NotImplementedError,"},{"line_number":1064,"context_line":"            lambda: list(self.conn.get_meter_statistics(f, groupby\u003d[\u0027wtf\u0027]))"},{"line_number":1065,"context_line":"        )"},{"line_number":1066,"context_line":""},{"line_number":1067,"context_line":"    def test_group_by_metadata(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F20U%3D","line":1064,"in_reply_to":"AAAASn%2F%2F4LM%3D","updated":"2013-08-28 19:45:23.000000000","message":"This is a hack which I used because the MongoDB get_meter_statistics() returns a list whereas the SQLAlchemy get_meter_statistics() returns a generator.  You have to apply list() to the SQLAlchemy generator to get it to throw an error.  As Julien said, the MongoDB get_meter_statistics() will throw an error before list() is called.  So this hack can cover both MongoDB and SQLAlchemy in a single test.\n\nGordon, if you\u0027d like, I could write a note \"HACK\" here to explain this lambda line.","commit_id":"0eebdce08b3ffd15b3bf27731b717fa8f9dec628"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"6c76cd836a3a430a2e74cabc343f02f3b1d8b26c","unresolved":false,"context_lines":[{"line_number":1061,"context_line":"        )"},{"line_number":1062,"context_line":"        self.assertRaises("},{"line_number":1063,"context_line":"            NotImplementedError,"},{"line_number":1064,"context_line":"            lambda: list(self.conn.get_meter_statistics(f, groupby\u003d[\u0027wtf\u0027]))"},{"line_number":1065,"context_line":"        )"},{"line_number":1066,"context_line":""},{"line_number":1067,"context_line":"    def test_group_by_metadata(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F4LM%3D","line":1064,"in_reply_to":"AAAASn%2F%2F4UY%3D","updated":"2013-08-28 14:35:40.000000000","message":"No it\u0027s correct, I already raise that point a while back. The function is not a generator in MongoDB so that fails before list is called.","commit_id":"0eebdce08b3ffd15b3bf27731b717fa8f9dec628"}]}
