)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"ad66e1c016f3f5811119c65ea41cab4b2bc70961","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add indexed column support to ovsdbapp"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add support for python-ovs multi-column indexes. This is currently"},{"line_number":10,"context_line":"disabled by default, though in a simple test of creating 10k"},{"line_number":11,"context_line":"Logical_Switches the time went from \"I give up after 10 mins\" to"},{"line_number":12,"context_line":"4 seconds. The only reason I didn\u0027t enable it by default was in"},{"line_number":13,"context_line":"case users want to tailor which columns they index."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"There are slight API changes w/ Backend.ovsdb_connection"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"ff570b3c_151f4ab7","line":12,"range":{"start_line":10,"start_character":47,"end_line":12,"end_character":9},"updated":"2020-05-18 13:19:19.000000000","message":"Great!!\nDo you have any numbers as to how long does for the indeces to be created?\n\nAlso, what\u0027s the memory cost?","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"5d88f7ed673d26fb1ec3c21a795100212111c911","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add indexed column support to ovsdbapp"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add support for python-ovs multi-column indexes. This is currently"},{"line_number":10,"context_line":"disabled by default, though in a simple test of creating 10k"},{"line_number":11,"context_line":"Logical_Switches the time went from \"I give up after 10 mins\" to"},{"line_number":12,"context_line":"4 seconds. The only reason I didn\u0027t enable it by default was in"},{"line_number":13,"context_line":"case users want to tailor which columns they index."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"There are slight API changes w/ Backend.ovsdb_connection"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"ff570b3c_9ba8ab8c","line":12,"range":{"start_line":10,"start_character":47,"end_line":12,"end_character":9},"in_reply_to":"ff570b3c_151f4ab7","updated":"2020-05-18 14:48:55.000000000","message":"The indexes themselves are created empty, so super fast. :) Then it is just a matter of inserting new objects in sorted order. For an overview of performance, see: http://www.grantjenks.com/docs/sortedcontainers/performance.html. We use SortedKeyList.\n\nAt our size, the answer is that the index overhead in speed is negligible.\n\nMemory-wise, since we are already storing the objects in memory, this *should* just be the overhead of storing a list of reference pointers per index.","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"ad66e1c016f3f5811119c65ea41cab4b2bc70961","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Add support for python-ovs multi-column indexes. This is currently"},{"line_number":10,"context_line":"disabled by default, though in a simple test of creating 10k"},{"line_number":11,"context_line":"Logical_Switches the time went from \"I give up after 10 mins\" to"},{"line_number":12,"context_line":"4 seconds. The only reason I didn\u0027t enable it by default was in"},{"line_number":13,"context_line":"case users want to tailor which columns they index."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"There are slight API changes w/ Backend.ovsdb_connection"},{"line_number":16,"context_line":"properties added and start_connection becoming an instance method"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"ff570b3c_959cfa0e","line":13,"range":{"start_line":12,"start_character":61,"end_line":13,"end_character":51},"updated":"2020-05-18 13:19:19.000000000","message":"Maybe for users to tailor this we need the numbers above or perhaps some recommendation? Looks like this could use a small doc section (follow up patch maybe) and a release note as it seems like a *big improvement*.","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a07c102fabf504a35dd1b30ea6679d0865ea6bda","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Add support for python-ovs multi-column indexes. This is currently"},{"line_number":10,"context_line":"disabled by default, though in a simple test of creating 10k"},{"line_number":11,"context_line":"Logical_Switches the time went from \"I give up after 10 mins\" to"},{"line_number":12,"context_line":"4 seconds. The only reason I didn\u0027t enable it by default was in"},{"line_number":13,"context_line":"case users want to tailor which columns they index."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"There are slight API changes w/ Backend.ovsdb_connection"},{"line_number":16,"context_line":"properties added and start_connection becoming an instance method"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"ff570b3c_60636243","line":13,"range":{"start_line":12,"start_character":61,"end_line":13,"end_character":51},"in_reply_to":"ff570b3c_959cfa0e","updated":"2020-05-18 14:07:04.000000000","message":"++ people need to hear about it!","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"5d88f7ed673d26fb1ec3c21a795100212111c911","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Add support for python-ovs multi-column indexes. This is currently"},{"line_number":10,"context_line":"disabled by default, though in a simple test of creating 10k"},{"line_number":11,"context_line":"Logical_Switches the time went from \"I give up after 10 mins\" to"},{"line_number":12,"context_line":"4 seconds. The only reason I didn\u0027t enable it by default was in"},{"line_number":13,"context_line":"case users want to tailor which columns they index."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"There are slight API changes w/ Backend.ovsdb_connection"},{"line_number":16,"context_line":"properties added and start_connection becoming an instance method"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"ff570b3c_fb71e745","line":13,"range":{"start_line":12,"start_character":61,"end_line":13,"end_character":51},"in_reply_to":"ff570b3c_959cfa0e","updated":"2020-05-18 14:48:55.000000000","message":"Yeah, I\u0027d like to see some browbeat testing for real-world numbers. Even on small DBs like running neutron tempest tests like `tox -e dsvm-functional ovn` shaves a couple of minutes of the runtime for me. Things like neutron-ovn-db-sync-util should be *way* faster.\n\nDocumentation is something that I started to add, but then realized \"oh yeah, there\u0027s no real documentation at all\" So I\u0027ve added a todo item for myself this week to write some base documentation that I can add indexing documentation to. :)","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"}],"ovsdbapp/backend/ovs_idl/__init__.py":[{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"d975c026b86a65933b81118a6edf2af22c38ab8b","unresolved":false,"context_lines":[{"line_number":59,"context_line":"            if cls.ovsdb_connection is None:"},{"line_number":60,"context_line":"                cls.ovsdb_connection \u003d connection"},{"line_number":61,"context_line":"                cls.ovsdb_connection.start()"},{"line_number":62,"context_line":"                cls.setup_indices()"},{"line_number":63,"context_line":"        except Exception as e:"},{"line_number":64,"context_line":"            connection_exception \u003d exceptions.OvsdbConnectionUnavailable("},{"line_number":65,"context_line":"                db_schema\u003dcls.schema, error\u003de)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_175cf84a","line":62,"updated":"2019-08-22 23:20:15.000000000","message":"Also note that for networking-ovn, which defines its own start_connection() to avoid the ovsdb_connection class variable scope, that this a) won\u0027t run and b) setup_indices() won\u0027t work because it accesses cls.ovsdb_connection.\n\nNeed to find a way to make all of that prettier w/o breaking the world.","commit_id":"36b84357aed808912bfc0ad9ec81dd06360d992b"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"65b46b2460840c1a7e761e9b82431bf66d57b1ff","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    lookup_table \u003d {}"},{"line_number":27,"context_line":"    _ovsdb_connection \u003d None"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def __init__(self, connection, start\u003dTrue, auto_index\u003dFalse, **kwargs):"},{"line_number":30,"context_line":"        super(Backend, self).__init__(**kwargs)"},{"line_number":31,"context_line":"        self.ovsdb_connection \u003d connection"},{"line_number":32,"context_line":"        if auto_index:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_7e74e268","line":29,"range":{"start_line":29,"start_character":47,"end_line":29,"end_character":63},"updated":"2020-05-14 13:42:26.000000000","message":"Is there any cons to have this defaulting to True ?","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4b18f32c70ee0f20cb5d3c5e6b5dc383e54e009d","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    lookup_table \u003d {}"},{"line_number":27,"context_line":"    _ovsdb_connection \u003d None"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def __init__(self, connection, start\u003dTrue, auto_index\u003dFalse, **kwargs):"},{"line_number":30,"context_line":"        super(Backend, self).__init__(**kwargs)"},{"line_number":31,"context_line":"        self.ovsdb_connection \u003d connection"},{"line_number":32,"context_line":"        if auto_index:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_ea3ae895","line":29,"range":{"start_line":29,"start_character":47,"end_line":29,"end_character":63},"in_reply_to":"ff570b3c_7e74e268","updated":"2020-05-14 19:35:14.000000000","message":"Mostly that it is a change in behavior--so if there is a bug someone theoretically could get bitten by it (though the code defaults to a normal lookup if it is not found in index). \n\nAlso, the change to start_connection() being an instance method and hiding the ovsdb_connection in a property due to Neutron overriding the Backend. I need to test whether neutron will croak w/ it starting out enabled.\n\nThe other thing is if users of the library wanted to be more limited in what they index, since indexing isn\u0027t free.\n\nMaybe default to True in master and to False in stable backports?","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"62fad4120b94ebd46cecbf588cea34a1c0a2ea4c","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        :type columns:  string"},{"line_number":53,"context_line":"        \"\"\""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        index_name \u003d \"_\".join(columns)"},{"line_number":56,"context_line":"        idx \u003d self.tables[table].rows.index_create(index_name)"},{"line_number":57,"context_line":"        idx.add_columns(*columns)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def autocreate_indices(self):"},{"line_number":60,"context_line":"        \"\"\"Create simple one-column indexes"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_f2030cb7","line":57,"range":{"start_line":55,"start_character":0,"end_line":57,"end_character":33},"updated":"2020-05-14 08:53:58.000000000","message":"Maybe a stupid question because I don\u0027t know exactly how it works under the hood, but what if there is a schema change and we have new column?\n\nThe new index will be created? What about the old one?","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"72a2c4cde4e01c2e186c2c4b2e30ba26e112432a","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        :type columns:  string"},{"line_number":53,"context_line":"        \"\"\""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        index_name \u003d \"_\".join(columns)"},{"line_number":56,"context_line":"        idx \u003d self.tables[table].rows.index_create(index_name)"},{"line_number":57,"context_line":"        idx.add_columns(*columns)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def autocreate_indices(self):"},{"line_number":60,"context_line":"        \"\"\"Create simple one-column indexes"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_6c726a13","line":57,"range":{"start_line":55,"start_character":0,"end_line":57,"end_character":33},"in_reply_to":"ff570b3c_9bec68f4","updated":"2020-05-15 07:51:23.000000000","message":"Cool! Thanks for the explanation!","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4b18f32c70ee0f20cb5d3c5e6b5dc383e54e009d","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        :type columns:  string"},{"line_number":53,"context_line":"        \"\"\""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        index_name \u003d \"_\".join(columns)"},{"line_number":56,"context_line":"        idx \u003d self.tables[table].rows.index_create(index_name)"},{"line_number":57,"context_line":"        idx.add_columns(*columns)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def autocreate_indices(self):"},{"line_number":60,"context_line":"        \"\"\"Create simple one-column indexes"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_9bec68f4","line":57,"range":{"start_line":55,"start_character":0,"end_line":57,"end_character":33},"in_reply_to":"ff570b3c_f2030cb7","updated":"2020-05-14 19:35:14.000000000","message":"If there\u0027s a schema change, we\u0027re restarting, and since all of this is in-memory, index is gone.","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"65b46b2460840c1a7e761e9b82431bf66d57b1ff","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        :type columns:  string"},{"line_number":53,"context_line":"        \"\"\""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        index_name \u003d \"_\".join(columns)"},{"line_number":56,"context_line":"        idx \u003d self.tables[table].rows.index_create(index_name)"},{"line_number":57,"context_line":"        idx.add_columns(*columns)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def autocreate_indices(self):"},{"line_number":60,"context_line":"        \"\"\"Create simple one-column indexes"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_beb95a2f","line":57,"range":{"start_line":55,"start_character":0,"end_line":57,"end_character":33},"in_reply_to":"ff570b3c_f2030cb7","updated":"2020-05-14 13:42:26.000000000","message":"Yeah, I don\u0027t know either. Are those in memory ? If so I think we are fine cos reconnections will happen once the db is upgraded","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b8a52073a56fa98d3458f0d411efd7dcd8ef2d2c","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            index_name \u003d col"},{"line_number":75,"context_line":"            try:"},{"line_number":76,"context_line":"                idx \u003d self.idl.tables[table].rows.index_create(index_name)"},{"line_number":77,"context_line":"                idx.add_column(col)"},{"line_number":78,"context_line":"                LOG.debug(\"Created index %s\", index_name)"},{"line_number":79,"context_line":"            except ValueError:"},{"line_number":80,"context_line":"                # index already exists"},{"line_number":81,"context_line":"                pass"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_67b73cf8","line":78,"range":{"start_line":77,"start_character":0,"end_line":78,"end_character":57},"updated":"2020-05-14 07:41:31.000000000","message":"I think it\u0027s safer to put these two to \"else\" block to limit the scope of ValueError on index_create only","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4b18f32c70ee0f20cb5d3c5e6b5dc383e54e009d","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            index_name \u003d col"},{"line_number":75,"context_line":"            try:"},{"line_number":76,"context_line":"                idx \u003d self.idl.tables[table].rows.index_create(index_name)"},{"line_number":77,"context_line":"                idx.add_column(col)"},{"line_number":78,"context_line":"                LOG.debug(\"Created index %s\", index_name)"},{"line_number":79,"context_line":"            except ValueError:"},{"line_number":80,"context_line":"                # index already exists"},{"line_number":81,"context_line":"                pass"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_2a450018","line":78,"range":{"start_line":77,"start_character":0,"end_line":78,"end_character":57},"in_reply_to":"ff570b3c_67b73cf8","updated":"2020-05-14 19:35:14.000000000","message":"Good point, will do.","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"62fad4120b94ebd46cecbf588cea34a1c0a2ea4c","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # Simple ovsdb-schema indices"},{"line_number":85,"context_line":"        for table in self.idl.tables.values():"},{"line_number":86,"context_line":"            if table.name not in tables:"},{"line_number":87,"context_line":"                continue"},{"line_number":88,"context_line":"            col \u003d idlutils.get_index_column(table)"},{"line_number":89,"context_line":"            if not col:"},{"line_number":90,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_92cbb070","line":87,"range":{"start_line":86,"start_character":0,"end_line":87,"end_character":24},"updated":"2020-05-14 08:53:58.000000000","message":"Is it possible that `table` will not be in `tables` if you get tables in L67?","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"72a2c4cde4e01c2e186c2c4b2e30ba26e112432a","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # Simple ovsdb-schema indices"},{"line_number":85,"context_line":"        for table in self.idl.tables.values():"},{"line_number":86,"context_line":"            if table.name not in tables:"},{"line_number":87,"context_line":"                continue"},{"line_number":88,"context_line":"            col \u003d idlutils.get_index_column(table)"},{"line_number":89,"context_line":"            if not col:"},{"line_number":90,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_ec5f9a6f","line":87,"range":{"start_line":86,"start_character":0,"end_line":87,"end_character":24},"in_reply_to":"ff570b3c_7b951440","updated":"2020-05-15 07:51:23.000000000","message":"++ ok","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4b18f32c70ee0f20cb5d3c5e6b5dc383e54e009d","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        # Simple ovsdb-schema indices"},{"line_number":85,"context_line":"        for table in self.idl.tables.values():"},{"line_number":86,"context_line":"            if table.name not in tables:"},{"line_number":87,"context_line":"                continue"},{"line_number":88,"context_line":"            col \u003d idlutils.get_index_column(table)"},{"line_number":89,"context_line":"            if not col:"},{"line_number":90,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_7b951440","line":87,"range":{"start_line":86,"start_character":0,"end_line":87,"end_character":24},"in_reply_to":"ff570b3c_92cbb070","updated":"2020-05-14 19:35:14.000000000","message":"table can be removed in L82. This way we don\u0027t try to create an index for a table that already had one created via lookup_table.","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b8a52073a56fa98d3458f0d411efd7dcd8ef2d2c","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            index_name \u003d col"},{"line_number":92,"context_line":"            try:"},{"line_number":93,"context_line":"                idx \u003d table.rows.index_create(index_name)"},{"line_number":94,"context_line":"                idx.add_column(col)"},{"line_number":95,"context_line":"                LOG.debug(\"Created index %s\", index_name)"},{"line_number":96,"context_line":"            except ValueError:"},{"line_number":97,"context_line":"                pass  # index already exists"},{"line_number":98,"context_line":"            tables.remove(table.name)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_278b841f","line":95,"range":{"start_line":94,"start_character":0,"end_line":95,"end_character":57},"updated":"2020-05-14 07:41:31.000000000","message":"ditto","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4b18f32c70ee0f20cb5d3c5e6b5dc383e54e009d","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            index_name \u003d col"},{"line_number":92,"context_line":"            try:"},{"line_number":93,"context_line":"                idx \u003d table.rows.index_create(index_name)"},{"line_number":94,"context_line":"                idx.add_column(col)"},{"line_number":95,"context_line":"                LOG.debug(\"Created index %s\", index_name)"},{"line_number":96,"context_line":"            except ValueError:"},{"line_number":97,"context_line":"                pass  # index already exists"},{"line_number":98,"context_line":"            tables.remove(table.name)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_ea6308b0","line":95,"range":{"start_line":94,"start_character":0,"end_line":95,"end_character":57},"in_reply_to":"ff570b3c_278b841f","updated":"2020-05-14 19:35:14.000000000","message":"will do.","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"3ab0fa3d4ee2bee565a307dacff7a14926bab61e","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    lookup_table \u003d {}"},{"line_number":27,"context_line":"    _ovsdb_connection \u003d None"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def __init__(self, connection, start\u003dTrue, auto_index\u003dTrue, **kwargs):"},{"line_number":30,"context_line":"        super(Backend, self).__init__(**kwargs)"},{"line_number":31,"context_line":"        self.ovsdb_connection \u003d connection"},{"line_number":32,"context_line":"        if auto_index:"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff570b3c_61af16e3","line":29,"range":{"start_line":29,"start_character":47,"end_line":29,"end_character":62},"updated":"2020-05-15 00:07:04.000000000","message":"Went ahead and made this default for master","commit_id":"c18a2264caa556bbe44bb211f2fe3cca72e8326d"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"3ab0fa3d4ee2bee565a307dacff7a14926bab61e","unresolved":false,"context_lines":[{"line_number":183,"context_line":"            return record.result"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        t \u003d self.tables[table]"},{"line_number":186,"context_line":"        if isinstance(record, uuid.UUID):"},{"line_number":187,"context_line":"            try:"},{"line_number":188,"context_line":"                return t.rows[record]"},{"line_number":189,"context_line":"            except KeyError:"},{"line_number":190,"context_line":"                raise idlutils.RowNotFound(table\u003dtable, col\u003d\u0027uuid\u0027,"},{"line_number":191,"context_line":"                                           match\u003drecord)"},{"line_number":192,"context_line":"        try:"},{"line_number":193,"context_line":"            uuid_ \u003d uuid.UUID(record)"},{"line_number":194,"context_line":"            return t.rows[uuid_]"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff570b3c_c1ec222b","line":191,"range":{"start_line":186,"start_character":0,"end_line":191,"end_character":56},"updated":"2020-05-15 00:07:04.000000000","message":"I moved this out of the try/except KeyError: pass due to a failing Neutron functional test that made me realize that this was silly. if you do a lookup(table, UUID(...)), you are very obviously looking up by UUID in that table. Lookups by name, etc. will never have a UUID type, so continuing to look for them is silly in addition to the fact that if a UUID is passed to the indexing code it will try to compare that uuid to the column type, which is not going to be a UUID and it will throw an exception.","commit_id":"c18a2264caa556bbe44bb211f2fe3cca72e8326d"},{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"425cd60261f3564ccb32e9b0411c2f8e2765e3be","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        if start:"},{"line_number":35,"context_line":"            self.start_connection(connection)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @property"},{"line_number":38,"context_line":"    def ovsdb_connection(self):"},{"line_number":39,"context_line":"        return self.__class__._ovsdb_connection"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    @ovsdb_connection.setter"},{"line_number":42,"context_line":"    def ovsdb_connection(self, connection):"},{"line_number":43,"context_line":"        if self.__class__._ovsdb_connection is None:"},{"line_number":44,"context_line":"            self.__class__._ovsdb_connection \u003d connection"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def create_index(self, table, *columns):"},{"line_number":47,"context_line":"        \"\"\"Create a multi-column index on a table"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff570b3c_bd84ae5f","line":44,"range":{"start_line":37,"start_character":0,"end_line":44,"end_character":57},"updated":"2020-05-15 10:30:17.000000000","message":"this almost feels like it belongs to a separate gerrit.\nbut that is just a nit comment. I say that because it steals\nthe thunder from the awesome indexing funtionality being added.","commit_id":"91b469911c6a76c86c8293f66272a0c199738d88"},{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"cc684ebdee00627bfbd42294c155f2c179597473","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        if start:"},{"line_number":35,"context_line":"            self.start_connection(connection)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @property"},{"line_number":38,"context_line":"    def ovsdb_connection(self):"},{"line_number":39,"context_line":"        return self.__class__._ovsdb_connection"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    @ovsdb_connection.setter"},{"line_number":42,"context_line":"    def ovsdb_connection(self, connection):"},{"line_number":43,"context_line":"        if self.__class__._ovsdb_connection is None:"},{"line_number":44,"context_line":"            self.__class__._ovsdb_connection \u003d connection"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def create_index(self, table, *columns):"},{"line_number":47,"context_line":"        \"\"\"Create a multi-column index on a table"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff570b3c_9f7f17df","line":44,"range":{"start_line":37,"start_character":0,"end_line":44,"end_character":57},"in_reply_to":"ff570b3c_90ef0c1d","updated":"2020-05-15 17:16:28.000000000","message":"no worries. I think it is fine as is.","commit_id":"91b469911c6a76c86c8293f66272a0c199738d88"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"7ca46612eede7a83406047d2b7dfc5713f4644c8","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        if start:"},{"line_number":35,"context_line":"            self.start_connection(connection)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @property"},{"line_number":38,"context_line":"    def ovsdb_connection(self):"},{"line_number":39,"context_line":"        return self.__class__._ovsdb_connection"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    @ovsdb_connection.setter"},{"line_number":42,"context_line":"    def ovsdb_connection(self, connection):"},{"line_number":43,"context_line":"        if self.__class__._ovsdb_connection is None:"},{"line_number":44,"context_line":"            self.__class__._ovsdb_connection \u003d connection"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def create_index(self, table, *columns):"},{"line_number":47,"context_line":"        \"\"\"Create a multi-column index on a table"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff570b3c_90ef0c1d","line":44,"range":{"start_line":37,"start_character":0,"end_line":44,"end_character":57},"in_reply_to":"ff570b3c_bd84ae5f","updated":"2020-05-15 14:02:56.000000000","message":"I went back and forth on it. On one hand, it isn\u0027t required for indexing to work on ovsdbapp. But it is required for indexing to be able to work on neutron with it\u0027s overridden start_connection  etc. In the end, I went with simplicity for reviewing/merging instead of what, I agree, would be technically better.","commit_id":"91b469911c6a76c86c8293f66272a0c199738d88"},{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"425cd60261f3564ccb32e9b0411c2f8e2765e3be","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        if self.__class__._ovsdb_connection is None:"},{"line_number":44,"context_line":"            self.__class__._ovsdb_connection \u003d connection"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def create_index(self, table, *columns):"},{"line_number":47,"context_line":"        \"\"\"Create a multi-column index on a table"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        :param table:   The table on which to create an index"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff570b3c_bd602ea7","line":46,"range":{"start_line":46,"start_character":4,"end_line":46,"end_character":44},"updated":"2020-05-15 10:30:17.000000000","message":"is there a place that uses this? I\u0027m having a hard time finding it. If not, maybe we need a unit test for it?","commit_id":"91b469911c6a76c86c8293f66272a0c199738d88"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"7ca46612eede7a83406047d2b7dfc5713f4644c8","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        if self.__class__._ovsdb_connection is None:"},{"line_number":44,"context_line":"            self.__class__._ovsdb_connection \u003d connection"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def create_index(self, table, *columns):"},{"line_number":47,"context_line":"        \"\"\"Create a multi-column index on a table"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        :param table:   The table on which to create an index"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff570b3c_50fd74af","line":46,"range":{"start_line":46,"start_character":4,"end_line":46,"end_character":44},"in_reply_to":"ff570b3c_bd602ea7","updated":"2020-05-15 14:02:56.000000000","message":"Yeah, it is there for the case of custom indexes/users who don\u0027t use auto_index\u003dTrue. It absolutely should have tests--god call. I\u0027ll probably add a functional test for it since requires actual tables/rows/interaction with python-ovs and I kind of hate all of the FakeTable/FakeRow stuff of unit tests when the functional tests suite runs everything in under 10s anyway. :D","commit_id":"91b469911c6a76c86c8293f66272a0c199738d88"},{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"425cd60261f3564ccb32e9b0411c2f8e2765e3be","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            self.__class__._ovsdb_connection \u003d connection"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def create_index(self, table, *columns):"},{"line_number":47,"context_line":"        \"\"\"Create a multi-column index on a table"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        :param table:   The table on which to create an index"},{"line_number":50,"context_line":"        :type table:    string"}],"source_content_type":"text/x-python","patch_set":13,"id":"ff570b3c_9d08cad9","line":47,"range":{"start_line":47,"start_character":11,"end_line":47,"end_character":49},"updated":"2020-05-15 10:30:17.000000000","message":"assuming this is something users may use to leverage indexing, maybe add a short description on how this is expected to be used?","commit_id":"91b469911c6a76c86c8293f66272a0c199738d88"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"c64a7d02a421a07d0c047ecf18adc48db6830f44","unresolved":false,"context_lines":[{"line_number":35,"context_line":"            self.start_connection(connection)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @property"},{"line_number":38,"context_line":"    def ovsdb_connection(self):"},{"line_number":39,"context_line":"        return self.__class__._ovsdb_connection"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    @ovsdb_connection.setter"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff570b3c_24235ebf","line":38,"updated":"2020-05-15 16:54:22.000000000","message":"These are now required for this patch because testing create_index() required them due to ovsdb_connection already being set up sometimes with indexing. So I lucked out re: having an excuse for not putting it in a separate patch. :D","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a07c102fabf504a35dd1b30ea6679d0865ea6bda","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        idx \u003d self.tables[table].rows.index_create(index_name)"},{"line_number":57,"context_line":"        idx.add_columns(*columns)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def autocreate_indices(self):"},{"line_number":60,"context_line":"        \"\"\"Create simple one-column indexes"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        This creates indexes for all lookup_table entries and for all defined"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff570b3c_bb3e4fb5","line":59,"updated":"2020-05-18 14:07:04.000000000","message":"nit: this feels like a method that should be \"private\" (quotes due to how encapsulation works in python :D)","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"5d88f7ed673d26fb1ec3c21a795100212111c911","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        idx \u003d self.tables[table].rows.index_create(index_name)"},{"line_number":57,"context_line":"        idx.add_columns(*columns)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def autocreate_indices(self):"},{"line_number":60,"context_line":"        \"\"\"Create simple one-column indexes"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        This creates indexes for all lookup_table entries and for all defined"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff570b3c_2d9cc2be","line":59,"in_reply_to":"ff570b3c_bb3e4fb5","updated":"2020-05-18 14:48:55.000000000","message":"Yeah, that makes sense.","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a07c102fabf504a35dd1b30ea6679d0865ea6bda","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        tables \u003d set(self.idl.tables.keys())"},{"line_number":68,"context_line":"        # lookup table indices"},{"line_number":69,"context_line":"        for table, (lt, col, uuid_col) in self.lookup_table.items():"},{"line_number":70,"context_line":"            if table !\u003d lt or not col or uuid_col or table not in tables:"},{"line_number":71,"context_line":"                # Just handle simple cases where we are looking up a single"},{"line_number":72,"context_line":"                # column on a single table"},{"line_number":73,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff570b3c_bb100f50","line":70,"range":{"start_line":70,"start_character":12,"end_line":70,"end_character":72},"updated":"2020-05-18 14:07:04.000000000","message":"nit: It\u0027s kinda hard to understand the logic here, perhaps a brief comment explaining these conditions would be helpful for those reading the code.","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"5d88f7ed673d26fb1ec3c21a795100212111c911","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        tables \u003d set(self.idl.tables.keys())"},{"line_number":68,"context_line":"        # lookup table indices"},{"line_number":69,"context_line":"        for table, (lt, col, uuid_col) in self.lookup_table.items():"},{"line_number":70,"context_line":"            if table !\u003d lt or not col or uuid_col or table not in tables:"},{"line_number":71,"context_line":"                # Just handle simple cases where we are looking up a single"},{"line_number":72,"context_line":"                # column on a single table"},{"line_number":73,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff570b3c_bb0bef27","line":70,"range":{"start_line":70,"start_character":12,"end_line":70,"end_character":72},"in_reply_to":"ff570b3c_bb100f50","updated":"2020-05-18 14:48:55.000000000","message":"That\u0027s what the comment below was trying to do, but yeah, probably from too high a level...the lookup_table semantics are super weird and confusing and need to be documented. It\u0027s basically a table that the various ctl CLI tools use to map up things like \"look up this row in this table by an index or by this column in another table\" etc. *Most* things are simple \"you can look this up by the name column.\" And for now, those are the only cases we care about.\n\nIt was kind of a hold-over from when we had the vsctl backend because we wanted the arguments to match the ovs-vsctl lookups and for a very few tables we needed the lookup_table. Now it\u0027s mostly \"Logical_Switch doesn\u0027t define an index for \u0027name\u0027, so add it so api.lookup() works for name lookups for Logical_Switch\". QoS can be looked up from the Port.qos, SSL table via Open_vSwitch.ssl, etc.\n\nThe (very basic) docs from where the logic was copied in OVS is here: https://github.com/openvswitch/ovs/blob/8508a57228560e154963c542823d36d8098e6610/lib/db-ctl-base.h#L252\n\nI\u0027ll make sure that that gets documented in a followup documentation patch.","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"c64a7d02a421a07d0c047ecf18adc48db6830f44","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        t \u003d self.tables[table]"},{"line_number":186,"context_line":"        if isinstance(record, uuid.UUID):"},{"line_number":187,"context_line":"            try:"},{"line_number":188,"context_line":"                return t.rows[record]"},{"line_number":189,"context_line":"            except KeyError:"},{"line_number":190,"context_line":"                raise idlutils.RowNotFound(table\u003dtable, col\u003d\u0027uuid\u0027,"},{"line_number":191,"context_line":"                                           match\u003drecord)"},{"line_number":192,"context_line":"        try:"},{"line_number":193,"context_line":"            uuid_ \u003d uuid.UUID(record)"},{"line_number":194,"context_line":"            return t.rows[uuid_]"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff570b3c_bf4e5b6c","line":191,"range":{"start_line":187,"start_character":0,"end_line":191,"end_character":56},"updated":"2020-05-15 16:54:22.000000000","message":"Moving this out of the other try/except because of a neutron test failure that exposed that passing a UUID() object when looking up by uuid or an index means you are really definitely looking for UUID--index columns aren\u0027t ever UUIDs (they may be strings representing UUIDs, but never an actual UUID object).","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"}],"ovsdbapp/backend/ovs_idl/idlutils.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"9e2aa56b5af3e4d48e0901a1c53f02aa0c002de2","unresolved":false,"context_lines":[{"line_number":62,"context_line":"def _fixup_match(match):"},{"line_number":63,"context_line":"    if isinstance(match, uuid.UUID):"},{"line_number":64,"context_line":"        return str(match)"},{"line_number":65,"context_line":"    elif isinstance(match, six.string_types):"},{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            return uuid.UUID(match)"},{"line_number":68,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff570b3c_64e3e106","line":65,"updated":"2020-05-12 18:01:21.000000000","message":"pep8: F821 undefined name \u0027six\u0027","commit_id":"ce371c2bcf97e7bf4f6682e887810697a689ebe8"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b8a52073a56fa98d3458f0d411efd7dcd8ef2d2c","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    elif isinstance(match, str):"},{"line_number":74,"context_line":"        try:"},{"line_number":75,"context_line":"            return uuid.UUID(match)"},{"line_number":76,"context_line":"        except Exception:"},{"line_number":77,"context_line":"            pass  # fail"},{"line_number":78,"context_line":"    raise TypeError(\"Cannot fixup match type %s\" % type(match))"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_479dd857","line":76,"range":{"start_line":76,"start_character":15,"end_line":76,"end_character":24},"updated":"2020-05-14 07:41:31.000000000","message":"Maybe a TypeError or something more specific here is safer?","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"65b46b2460840c1a7e761e9b82431bf66d57b1ff","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    elif isinstance(match, str):"},{"line_number":74,"context_line":"        try:"},{"line_number":75,"context_line":"            return uuid.UUID(match)"},{"line_number":76,"context_line":"        except Exception:"},{"line_number":77,"context_line":"            pass  # fail"},{"line_number":78,"context_line":"    raise TypeError(\"Cannot fixup match type %s\" % type(match))"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_7edd026f","line":76,"range":{"start_line":76,"start_character":15,"end_line":76,"end_character":24},"in_reply_to":"ff570b3c_479dd857","updated":"2020-05-14 13:42:26.000000000","message":"++ or a log","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4b18f32c70ee0f20cb5d3c5e6b5dc383e54e009d","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    elif isinstance(match, str):"},{"line_number":74,"context_line":"        try:"},{"line_number":75,"context_line":"            return uuid.UUID(match)"},{"line_number":76,"context_line":"        except Exception:"},{"line_number":77,"context_line":"            pass  # fail"},{"line_number":78,"context_line":"    raise TypeError(\"Cannot fixup match type %s\" % type(match))"},{"line_number":79,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_8aa36c9e","line":76,"range":{"start_line":76,"start_character":15,"end_line":76,"end_character":24},"in_reply_to":"ff570b3c_7edd026f","updated":"2020-05-14 19:35:14.000000000","message":"uuid.UUID() can raise all kinds of errors (\"bob\" would do ValueError, 1234 would do AttributeError, etc.), we just pass through and raise a TypeError no matter what with the type that was passed in the Exception.\n\nI guess I originally was thinking that info would be sufficient for debugging, but right now, since we don\u0027t try to catch any errors from _fixup_match (and it shouldn\u0027t ever return a KeyError), we could just get rid of try/except altogether and just raise whatever we get. Does that sound better?","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"425cd60261f3564ccb32e9b0411c2f8e2765e3be","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    :type matches:  The types of the columns being matched"},{"line_number":63,"context_line":"    :returns:       A Row object"},{"line_number":64,"context_line":"    \"\"\""},{"line_number":65,"context_line":"    idx \u003d table.rows.indexes[\"_\".join(matches.keys())]"},{"line_number":66,"context_line":"    search \u003d table.rows.IndexEntry(**matches)"},{"line_number":67,"context_line":"    return next(idx.irange(search, search))"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"ff570b3c_3d41be3a","line":65,"range":{"start_line":65,"start_character":29,"end_line":65,"end_character":53},"updated":"2020-05-15 10:30:17.000000000","message":"Is there ever a case when the str from keys() change? \nI am not sure if we can expect python to consistently give the keys in the same order.","commit_id":"91b469911c6a76c86c8293f66272a0c199738d88"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"7ca46612eede7a83406047d2b7dfc5713f4644c8","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    :type matches:  The types of the columns being matched"},{"line_number":63,"context_line":"    :returns:       A Row object"},{"line_number":64,"context_line":"    \"\"\""},{"line_number":65,"context_line":"    idx \u003d table.rows.indexes[\"_\".join(matches.keys())]"},{"line_number":66,"context_line":"    search \u003d table.rows.IndexEntry(**matches)"},{"line_number":67,"context_line":"    return next(idx.irange(search, search))"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"ff570b3c_f0e488e2","line":65,"range":{"start_line":65,"start_character":29,"end_line":65,"end_character":53},"in_reply_to":"ff570b3c_3d41be3a","updated":"2020-05-15 14:02:56.000000000","message":"In python 3.6*+ dictionaries maintain their insertion order, but you\u0027re right this seems sketchy. I\u0027ll create:\n\n def index_name(**columns):\n     return \"_\".join(sorted(columns.keys()))\n\nand write some unit tests. (Finally, a function that is perfect for those!)","commit_id":"91b469911c6a76c86c8293f66272a0c199738d88"},{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"425cd60261f3564ccb32e9b0411c2f8e2765e3be","unresolved":false,"context_lines":[{"line_number":70,"context_line":"def _fixup_match(match):"},{"line_number":71,"context_line":"    if isinstance(match, uuid.UUID):"},{"line_number":72,"context_line":"        return str(match)"},{"line_number":73,"context_line":"    elif isinstance(match, str):"},{"line_number":74,"context_line":"        return uuid.UUID(match)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"ff570b3c_7d64d6e4","line":73,"range":{"start_line":73,"start_character":0,"end_line":73,"end_character":32},"updated":"2020-05-15 10:30:17.000000000","message":"is None a valid answer? If not, we could \u0027blindly\u0027\nreturn uuid.UUID(match) and skip the \u0027elif\u0027 all together.\nException expected, of course. ;)","commit_id":"91b469911c6a76c86c8293f66272a0c199738d88"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"7ca46612eede7a83406047d2b7dfc5713f4644c8","unresolved":false,"context_lines":[{"line_number":70,"context_line":"def _fixup_match(match):"},{"line_number":71,"context_line":"    if isinstance(match, uuid.UUID):"},{"line_number":72,"context_line":"        return str(match)"},{"line_number":73,"context_line":"    elif isinstance(match, str):"},{"line_number":74,"context_line":"        return uuid.UUID(match)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"ff570b3c_5043b4af","line":73,"range":{"start_line":73,"start_character":0,"end_line":73,"end_character":32},"in_reply_to":"ff570b3c_7d64d6e4","updated":"2020-05-15 14:02:56.000000000","message":"I think you are right. I\u0027ll test it. Now there is a part of me that wants to just remove this and make people use code that passes the correct type...but I have a feeling there will be errors (surely I wrote this for a reason back in the day!).","commit_id":"91b469911c6a76c86c8293f66272a0c199738d88"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"c64a7d02a421a07d0c047ecf18adc48db6830f44","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        return index_lookup(tab, **{column: match})"},{"line_number":84,"context_line":"    except KeyError:  # no index column"},{"line_number":85,"context_line":"        try:"},{"line_number":86,"context_line":"            return table_lookup(tab, column, match)"},{"line_number":87,"context_line":"        except StopIteration:"},{"line_number":88,"context_line":"            pass"},{"line_number":89,"context_line":"    except StopIteration:  # match not found via index"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff570b3c_5f457f42","line":86,"range":{"start_line":86,"start_character":12,"end_line":86,"end_character":51},"updated":"2020-05-15 16:54:22.000000000","message":"Moved this to a separate function to facilitate testing with assert_not_called to ensure that we found the value through an index.","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"}],"ovsdbapp/tests/functional/backend/ovs_idl/test_indexing.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b8a52073a56fa98d3458f0d411efd7dcd8ef2d2c","unresolved":false,"context_lines":[{"line_number":23,"context_line":"        self.api \u003d impl_idl.OvnNbApiIdlImpl(self.connection, auto_index\u003dTrue)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    def test_find(self):"},{"line_number":26,"context_line":"        # This test will easily time out if indexing isn\u0027t used"},{"line_number":27,"context_line":"        length \u003d 2000"},{"line_number":28,"context_line":"        basename \u003d utils.get_rand_device_name(\u0027testswitch\u0027)"},{"line_number":29,"context_line":"        with self.api.transaction(check_error\u003dTrue) as txn:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_e7c6ac48","line":26,"updated":"2020-05-14 07:41:31.000000000","message":"nice :)","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"}],"ovsdbapp/tests/unit/backend/ovs_idl/test_idlutils.py":[{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"cc684ebdee00627bfbd42294c155f2c179597473","unresolved":false,"context_lines":[{"line_number":170,"context_line":"                                     FAKE_RECORD_GUID)"},{"line_number":171,"context_line":"        self.assertEqual(mock.sentinel.row_value, res)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def test_index_name(self):"},{"line_number":174,"context_line":"        expected \u003d {"},{"line_number":175,"context_line":"            (\u0027one\u0027,): \u0027one\u0027,"},{"line_number":176,"context_line":"            (\u0027abc\u0027, \u0027def\u0027): \u0027abc_def\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"ff570b3c_1fd947f2","line":173,"range":{"start_line":173,"start_character":4,"end_line":173,"end_character":30},"updated":"2020-05-15 17:16:28.000000000","message":"nice!","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"}],"ovsdbapp/tests/unit/backend/test_ovs_idl.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b8a52073a56fa98d3458f0d411efd7dcd8ef2d2c","unresolved":false,"context_lines":[{"line_number":10,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"# under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"from collections import UserDict"},{"line_number":14,"context_line":"from unittest import mock"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from ovsdbapp.backend import ovs_idl"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_67e8dcb3","line":13,"range":{"start_line":13,"start_character":0,"end_line":13,"end_character":32},"updated":"2020-05-14 07:41:31.000000000","message":"nit: OpenStack guidelines discourage importing objects, import the whole module instead","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"65b46b2460840c1a7e761e9b82431bf66d57b1ff","unresolved":false,"context_lines":[{"line_number":10,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"# under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"from collections import UserDict"},{"line_number":14,"context_line":"from unittest import mock"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from ovsdbapp.backend import ovs_idl"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_fe0592c3","line":13,"range":{"start_line":13,"start_character":0,"end_line":13,"end_character":32},"in_reply_to":"ff570b3c_67e8dcb3","updated":"2020-05-14 13:42:26.000000000","message":"++","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4b18f32c70ee0f20cb5d3c5e6b5dc383e54e009d","unresolved":false,"context_lines":[{"line_number":10,"context_line":"# License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"# under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"from collections import UserDict"},{"line_number":14,"context_line":"from unittest import mock"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from ovsdbapp.backend import ovs_idl"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff570b3c_cac60449","line":13,"range":{"start_line":13,"start_character":0,"end_line":13,"end_character":32},"in_reply_to":"ff570b3c_fe0592c3","updated":"2020-05-14 19:35:14.000000000","message":"but then I have to break up the line because it gets too long! :p (always hated that rule as an absolute--I know I\u0027m not going to define a UserDict somewhere :D)\n\n/me changes it :D","commit_id":"fe764d5c1d302395049c0db89a2369e03974f4c7"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"c64a7d02a421a07d0c047ecf18adc48db6830f44","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    def start_connection(self, connection):"},{"line_number":39,"context_line":"        pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def autocreate_indices(self):"},{"line_number":42,"context_line":"        pass"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"ff570b3c_bf9c9bc0","line":41,"updated":"2020-05-15 16:54:22.000000000","message":"To avoid having to mock more stuff out for this test which really isn\u0027t necessary since it is covered 100s of times w/ functional tests.","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a07c102fabf504a35dd1b30ea6679d0865ea6bda","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    def start_connection(self, connection):"},{"line_number":39,"context_line":"        pass"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def autocreate_indices(self):"},{"line_number":42,"context_line":"        pass"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"ff570b3c_c086aeb9","line":41,"in_reply_to":"ff570b3c_bf9c9bc0","updated":"2020-05-18 14:07:04.000000000","message":"nit: Would be good to have this explanation as a comment in the code :D","commit_id":"db0cdd9a4ffd64d99a6b012b5d0bf2c5bd4f96f4"}],"ovsdbapp/tests/unit/schema/open_vswitch/test_impl_idl.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"9e2aa56b5af3e4d48e0901a1c53f02aa0c002de2","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def test_init_session(self):"},{"line_number":50,"context_line":"        conn \u003d mock.MagicMock()"},{"line_number":51,"context_line":"        backend \u003d impl_idl.OvsdbIdl(conn, start\u003dFalse)"},{"line_number":52,"context_line":"        conn.start_connection.assert_not_called()"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff570b3c_c4f0edcc","line":51,"updated":"2020-05-12 18:01:21.000000000","message":"pep8: F841 local variable \u0027backend\u0027 is assigned to but never used","commit_id":"ce371c2bcf97e7bf4f6682e887810697a689ebe8"}]}
