)]}'
{"dragonflow/db/db_api.py":[{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"3eb4659d774ec1a7ba6b62c41a9a8563f68dc7fe","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    def set_key(self, table, key, value, topic\u003dNone):"},{"line_number":75,"context_line":"        \"\"\"Set a specific key in a table with value. If the key does not"},{"line_number":76,"context_line":"        exist, the implementation may either:"},{"line_number":77,"context_line":"        1. Raise a DBLeyNotFound error"},{"line_number":78,"context_line":"        2. Create the key as if create_key was called."},{"line_number":79,"context_line":"        Exactly one of these two option must be implemented"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        :param table:      table name"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_fb064d1c","line":78,"range":{"start_line":77,"start_character":0,"end_line":78,"end_character":54},"updated":"2017-08-28 09:12:31.000000000","message":"why not allow exactly one of those?","commit_id":"07750acd2cc8245b48ae5dfa522f2b23b734c02c"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"af4427a6f8f8533c46bba27495afbc6b716e3c15","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    def set_key(self, table, key, value, topic\u003dNone):"},{"line_number":75,"context_line":"        \"\"\"Set a specific key in a table with value. If the key does not"},{"line_number":76,"context_line":"        exist, the implementation may either:"},{"line_number":77,"context_line":"        1. Raise a DBLeyNotFound error"},{"line_number":78,"context_line":"        2. Create the key as if create_key was called."},{"line_number":79,"context_line":"        Exactly one of these two option must be implemented"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        :param table:      table name"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_93296d9c","line":78,"range":{"start_line":77,"start_character":0,"end_line":78,"end_character":54},"in_reply_to":"7f287b81_4197aeed","updated":"2017-08-28 12:10:21.000000000","message":"That\u0027s reasonable","commit_id":"07750acd2cc8245b48ae5dfa522f2b23b734c02c"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"128d91ecc783fd4336d86d9796209169d2df8cc1","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    def set_key(self, table, key, value, topic\u003dNone):"},{"line_number":75,"context_line":"        \"\"\"Set a specific key in a table with value. If the key does not"},{"line_number":76,"context_line":"        exist, the implementation may either:"},{"line_number":77,"context_line":"        1. Raise a DBLeyNotFound error"},{"line_number":78,"context_line":"        2. Create the key as if create_key was called."},{"line_number":79,"context_line":"        Exactly one of these two option must be implemented"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        :param table:      table name"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_4197aeed","line":78,"range":{"start_line":77,"start_character":0,"end_line":78,"end_character":54},"in_reply_to":"7f287b81_fb064d1c","updated":"2017-08-28 11:07:48.000000000","message":"This is a scenario that shouldn\u0027t happen anyway. Checking if the key exists first may impose additional overhead on the driver/db. Creating the key if it doesn\u0027t exist may cause implementation to deal with logic that should be external.\n\nI prefer to let implementations do what is easiest for them. If we need to select the second option, we can add (here) a set_key_safe(...) which tries to call set, and upon exception calls create.","commit_id":"07750acd2cc8245b48ae5dfa522f2b23b734c02c"}]}
