)]}'
{"ceilometer/transformer/conversions.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a125dfaf6d81cb30b9fb20f61188765734292fce","unresolved":false,"context_lines":[{"line_number":216,"context_line":"    def _get_unique_key(self, s):"},{"line_number":217,"context_line":"        non_aggregated_keys \u003d \"-\".join([getattr(s, field)"},{"line_number":218,"context_line":"                                        for field in self.key_attributes"},{"line_number":219,"context_line":"                                        if getattr(s, field) is not None])"},{"line_number":220,"context_line":"        #NOTE(sileht): it assumes, a meter always have the same unit/type"},{"line_number":221,"context_line":"        return \"%s-%s-%s\" % (s.name, s.resource_id, non_aggregated_keys)"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_0d589356","line":219,"updated":"2014-06-23 13:48:48.000000000","message":"Would an explanation of when/why `None` might be the case (in a comment or docstring) be useful here? Without more context, it\u0027s not obvious.","commit_id":"d309c367b920ebb972a2e2db2ca82a07eeb514f0"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"a836f6786b27805cd2686bb2193e14f81cd061d5","unresolved":false,"context_lines":[{"line_number":216,"context_line":"    def _get_unique_key(self, s):"},{"line_number":217,"context_line":"        non_aggregated_keys \u003d \"-\".join([getattr(s, field)"},{"line_number":218,"context_line":"                                        for field in self.key_attributes"},{"line_number":219,"context_line":"                                        if getattr(s, field) is not None])"},{"line_number":220,"context_line":"        #NOTE(sileht): it assumes, a meter always have the same unit/type"},{"line_number":221,"context_line":"        return \"%s-%s-%s\" % (s.name, s.resource_id, non_aggregated_keys)"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_d343aa11","line":219,"in_reply_to":"1ae5cdf2_0d589356","updated":"2014-06-23 14:19:56.000000000","message":"I think it\u0027s better to always have the same key format for all samples. Perhaps replacing the missing field by the string \u0027\u003cundefined\u003e\u0027 , WDYT ?","commit_id":"d309c367b920ebb972a2e2db2ca82a07eeb514f0"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"b44ea9b0ff618db7a78d26b7f89b22020c0f9843","unresolved":false,"context_lines":[{"line_number":214,"context_line":"            self.key_attributes.append(name)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def _get_unique_key(self, s):"},{"line_number":217,"context_line":"        #NOTE(arezmerita): in samples generated by ceilometer middleware,"},{"line_number":218,"context_line":"        #when accessing without authentication publicly readable/writable"},{"line_number":219,"context_line":"        #swift containers, the project_id and the user_id are missing."},{"line_number":220,"context_line":"        #They will be replaced by \u003cundefined\u003e for unique key construction."}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_c16f54fb","line":217,"updated":"2014-06-23 15:27:08.000000000","message":"Add a space after each # (next pep8/hacking update will fail on that)","commit_id":"fe158b67022ab0ac1df8a4fab48cdca5bb6c5c87"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"319725240db67be191f8c944ee24d210caf51316","unresolved":false,"context_lines":[{"line_number":214,"context_line":"            self.key_attributes.append(name)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def _get_unique_key(self, s):"},{"line_number":217,"context_line":"        non_aggregated_keys \u003d \"-\".join([getattr(s, field)"},{"line_number":218,"context_line":"                                        for field in self.key_attributes])"},{"line_number":219,"context_line":"        #NOTE(sileht): it assumes, a meter always have the same unit/type"},{"line_number":220,"context_line":"        return \"%s-%s-%s\" % (s.name, s.resource_id, non_aggregated_keys)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_fc6bfcb6","side":"PARENT","line":217,"updated":"2014-06-24 04:11:47.000000000","message":"nit: no need to expand to L221-L227 on the patchset 3, just s/getattr(s, field)/getattr(s, field, \u0027\u003cundefined\u003e\u0027)/ will be fine. The note looks good","commit_id":"a430fb923dc7e3b04456898e87f81d6ab8f0e3cd"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"51f474cdc2bbaeb9f8cd13731b35394b3ce82f47","unresolved":false,"context_lines":[{"line_number":214,"context_line":"            self.key_attributes.append(name)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def _get_unique_key(self, s):"},{"line_number":217,"context_line":"        non_aggregated_keys \u003d \"-\".join([getattr(s, field)"},{"line_number":218,"context_line":"                                        for field in self.key_attributes])"},{"line_number":219,"context_line":"        #NOTE(sileht): it assumes, a meter always have the same unit/type"},{"line_number":220,"context_line":"        return \"%s-%s-%s\" % (s.name, s.resource_id, non_aggregated_keys)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_f257a558","side":"PARENT","line":217,"in_reply_to":"1ae5cdf2_3293cda5","updated":"2014-06-24 06:22:41.000000000","message":"yes, you\u0027re right","commit_id":"a430fb923dc7e3b04456898e87f81d6ab8f0e3cd"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"7b1493ae061a78dfc5b1c5a601f53ccbf86d33d1","unresolved":false,"context_lines":[{"line_number":214,"context_line":"            self.key_attributes.append(name)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def _get_unique_key(self, s):"},{"line_number":217,"context_line":"        non_aggregated_keys \u003d \"-\".join([getattr(s, field)"},{"line_number":218,"context_line":"                                        for field in self.key_attributes])"},{"line_number":219,"context_line":"        #NOTE(sileht): it assumes, a meter always have the same unit/type"},{"line_number":220,"context_line":"        return \"%s-%s-%s\" % (s.name, s.resource_id, non_aggregated_keys)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_3293cda5","side":"PARENT","line":217,"in_reply_to":"1ae5cdf2_fc6bfcb6","updated":"2014-06-24 06:02:27.000000000","message":"getattr(s, field, \u0027\u003cundefined\u003e\u0027) won\u0027t works, it returns \u0027\u003cundefined\u003e\u0027 only if the field doesn\u0027t exists, not if the content is None.","commit_id":"a430fb923dc7e3b04456898e87f81d6ab8f0e3cd"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"9e136aef4aedeb3f340b0e59fcb845d1515eb2a7","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        # when accessing without authentication publicly readable/writable"},{"line_number":219,"context_line":"        # swift containers, the project_id and the user_id are missing."},{"line_number":220,"context_line":"        # They will be replaced by \u003cundefined\u003e for unique key construction."},{"line_number":221,"context_line":"        keys \u003d []"},{"line_number":222,"context_line":"        for field in self.key_attributes:"},{"line_number":223,"context_line":"            if getattr(s, field) is None:"},{"line_number":224,"context_line":"                keys.append(\u0027\u003cundefined\u003e\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baada198_184aa583","line":221,"updated":"2014-06-30 14:25:40.000000000","message":"More pythonic as:\n\n  keys \u003d [\u0027\u003cundefined\u003e\u0027 if getattr(s, f) is None else getattr(s, f)\n          for f in self.key_attributes]","commit_id":"381b46cde7562d16b55bd84508aa53b9ebc37f55"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"change_message_id":"319725240db67be191f8c944ee24d210caf51316","unresolved":false,"context_lines":[{"line_number":225,"context_line":"            else:"},{"line_number":226,"context_line":"                keys.append(getattr(s, field))"},{"line_number":227,"context_line":"        non_aggregated_keys \u003d \"-\".join(keys)"},{"line_number":228,"context_line":"        #NOTE(sileht): it assumes, a meter always have the same unit/type"},{"line_number":229,"context_line":"        return \"%s-%s-%s\" % (s.name, s.resource_id, non_aggregated_keys)"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    def handle_sample(self, context, sample):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_3c6564e2","line":228,"updated":"2014-06-24 04:11:47.000000000","message":"optional: add a space after \u0027#\u0027 too?","commit_id":"381b46cde7562d16b55bd84508aa53b9ebc37f55"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"91c2eb59ef829cd1b67d0114c776fe826f084b22","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        # when accessing without authentication publicly readable/writable"},{"line_number":219,"context_line":"        # swift containers, the project_id and the user_id are missing."},{"line_number":220,"context_line":"        # They will be replaced by \u003cundefined\u003e for unique key construction."},{"line_number":221,"context_line":"        keys \u003d [\u0027\u003cundefined\u003e\u0027 if getattr(s, f) is None else getattr(s, f)"},{"line_number":222,"context_line":"                for f in self.key_attributes]"},{"line_number":223,"context_line":"        non_aggregated_keys \u003d \"-\".join(keys)"},{"line_number":224,"context_line":"        # NOTE(sileht): it assumes, a meter always have the same unit/type"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_c48c4d38","line":221,"updated":"2014-07-03 09:18:48.000000000","message":"can we not just use getattr(s,f,\u0027\u003cundefined\u003e\u0027) instead of having check:\n\n\"-\".join([getattr(s, field, \u0027undefined\u0027) for field in self.key_attributes])","commit_id":"3fcdd15c579f69d71cd64b7ad412feb90344de72"},{"author":{"_account_id":7781,"name":"Ala Rezmerita","email":"ala.rezmerita@orange.com","username":"alla"},"change_message_id":"19f3691b60efe138279d010b7e9e25116b0946af","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        # when accessing without authentication publicly readable/writable"},{"line_number":219,"context_line":"        # swift containers, the project_id and the user_id are missing."},{"line_number":220,"context_line":"        # They will be replaced by \u003cundefined\u003e for unique key construction."},{"line_number":221,"context_line":"        keys \u003d [\u0027\u003cundefined\u003e\u0027 if getattr(s, f) is None else getattr(s, f)"},{"line_number":222,"context_line":"                for f in self.key_attributes]"},{"line_number":223,"context_line":"        non_aggregated_keys \u003d \"-\".join(keys)"},{"line_number":224,"context_line":"        # NOTE(sileht): it assumes, a meter always have the same unit/type"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_bf868263","line":221,"in_reply_to":"baada198_c48c4d38","updated":"2014-07-03 09:34:39.000000000","message":"getattr(s, field, \u0027\u003cundefined\u003e\u0027) won\u0027t work, it will returns \u0027\u003cundefined\u003e\u0027 only if the field doesn\u0027t exists, not if the content is None.","commit_id":"3fcdd15c579f69d71cd64b7ad412feb90344de72"}]}
